diff options
| author | Saif Ahmed <34284663+saiftynet@users.noreply.github.com> | 2019-12-04 21:56:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-04 21:56:10 +0000 |
| commit | c54e605b3ad3f97a653101dc6339f8fdf7dc566f (patch) | |
| tree | 0d4049afd62f2140cfd83dd1478afb3a30b609bc /challenge-037/saiftynet | |
| parent | 03f61bbf33a8360b23882639007f2fa59ccae278 (diff) | |
| download | perlweeklychallenge-club-c54e605b3ad3f97a653101dc6339f8fdf7dc566f.tar.gz perlweeklychallenge-club-c54e605b3ad3f97a653101dc6339f8fdf7dc566f.tar.bz2 perlweeklychallenge-club-c54e605b3ad3f97a653101dc6339f8fdf7dc566f.zip | |
Update ch-2.pl
Added abs to make difference always positive
Diffstat (limited to 'challenge-037/saiftynet')
| -rw-r--r-- | challenge-037/saiftynet/perl5/ch-2.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-037/saiftynet/perl5/ch-2.pl b/challenge-037/saiftynet/perl5/ch-2.pl index 7c328695d0..f409971c67 100644 --- a/challenge-037/saiftynet/perl5/ch-2.pl +++ b/challenge-037/saiftynet/perl5/ch-2.pl @@ -10,7 +10,7 @@ use LWP::Simple qw(get); my $difference=getDayLight( country=>"uk", city =>"london", month =>"11", year =>"2019", ) - getDayLight( country=>"uk", city =>"london", month =>"12", year =>"2019", ); -print "\n\nThe difference in daylight is ".s2hms($difference)."(Hours:Minutes:Seconds)\n"; +print "\n\nThe difference in daylight is ".s2hms(abs($difference))."(Hours:Minutes:Seconds)\n"; sub s2hms{ # converts seconds to days hours minutes and seconds my $time=shift; |
