in reply to create array from strftime
Problem #1: strftime doesn't take an epoch time for argument.
Problem #2: strftime returns a single string.
Then there's also the fact that "3 scalars" are not "an array".
Solution:
my ($day, $month, $year) = (localtime)[3,4,5]; $month += 1; $year += 1900;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: create array from strftime
by taint (Chaplain) on Jun 20, 2012 at 18:07 UTC | |
by ikegami (Patriarch) on Jun 20, 2012 at 19:45 UTC | |
by taint (Chaplain) on Jun 20, 2012 at 22:19 UTC |