Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hope someone will be able to help me. I tried looking at previous answers and questions but did not find a solution.
Restrictions: Perl v. 5.8.4, Solaris 10, default modules
I would like to convert a specified time (e.g., Wed Feb 4 12:34:56 2015) to an epoch time using one line of Perl.
I was thinking about using:
echo "56,34,12,4,1,115"|perl -MPOSIX -e 'print mktime(<stdin>)'However, <stdin> is treated as just one variable instead of all the variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert Time to Epoch Using External Variable
by choroba (Cardinal) on Feb 04, 2015 at 14:45 UTC | |
by QM (Parson) on Feb 04, 2015 at 15:08 UTC | |
by johngg (Canon) on Feb 04, 2015 at 22:49 UTC | |
by Anonymous Monk on Feb 04, 2015 at 15:03 UTC |