in reply to 24 hour to 12 hour using DateTime
As documented in the strftime Patterns section of DateTime, 12-hour time (without a leading zero) corresponds to %l, so
or possiblymy $dateadded_time = $dt->strftime("%l:%M");
my $dateadded_time = $dt->strftime("%l:%M %P");
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 24 hour to 12 hour using DateTime
by htmanning (Friar) on Aug 01, 2014 at 08:30 UTC |