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.
In reply to Re: 24 hour to 12 hour using DateTime
by kennethk
in thread 24 hour to 12 hour using DateTime
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |