in reply to Re: Converting 24 hour time back into 12 hour
in thread Converting 24 hour time back into 12 hour
hi,
slight correction:
sub to12h { local $_=shift; if (($_ < 0) || ($_ > 23)) { return ("$_ is not a valid hour"); } return ($_, "AM") if $_ < 12; return ($_, "PM") if $_ == 12; return ($_ -12, "PM") } for (0..23) { print join " ", to12h($_), "\n"; }
Jason L. Froebe
No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Converting 24 hour time back into 12 hour
by theorbtwo (Prior) on Nov 07, 2004 at 17:02 UTC | |
|
Re^3: Converting 24 hour time back into 12 hour
by Lana (Beadle) on May 27, 2013 at 03:31 UTC | |
by Anonymous Monk on Nov 04, 2015 at 03:32 UTC |