Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Converting 24 hour time back into 12 hour

by Lana (Beadle)
on May 27, 2013 at 03:31 UTC ( [id://1035350]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Converting 24 hour time back into 12 hour
in thread Converting 24 hour time back into 12 hour

one more correction - you have forgot to convert 24hr's 00 hours to 12AM
sub to12h { local $_=shift; if (($_ < 0) || ($_ > 23)) { return ("$_ is not a valid hour"); } return (12, "AM") if $_ == 0; return ($_, "AM") if $_ < 12; return ($_, "PM") if $_ == 12; return ($_ -12, "PM"); } for (0..23) { print join " ", to12h($_), "\n"; }

Replies are listed 'Best First'.
Re^4: Converting 24 hour time back into 12 hour
by Anonymous Monk on Nov 04, 2015 at 03:32 UTC
    there is no such thing as 24:00hrs...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1035350]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found