$ampm = ( $hour < 12 ? 'am' : 'pm' ); if($hour > 12){ $hour -=12; }
(I would have overlooked the am/pm requirement if someone hadn't gotten here first . . . Thanks ikegami ;)
Whenever I have a time question I usually go to The many dates and times of Perl but I didn't see anything applicable there. Of course, I'm sleepy and very well may have overlooked something.
In reply to Re: How do I convert localtime to display 12 hr time instead of 24 hr time
by eighty-one
in thread How do I convert localtime to display 12 hr time instead of 24 hr time
by CG_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |