Ask a Question related to PERL Miscellaneous, Design and Development.
-
Farid Hamjavar UNM-CIRT #1
from epoch to date string
greetings,
is there a revers of this below -- in a one-liner format?
i.e. input to be `date` and output to be number of
seconds since epoch.
% perl -e 'print scalar localtime (1061161826), "\n"'
Sun Aug 17 17:10:39 MDT 2003
Thanks
Farid
Farid Hamjavar UNM-CIRT Guest
-
Convert Epoch Date
I'm working with an SQL database that stores dates in integer fields. I'm using Coldfusion and was wondering if there is a function to convert... -
Need a function to go from a timestamp to the number of seconds since Epoch..
Hey all! I know there's a function to take the number of seconds and places that information into seperate time components (localtime and... -
extract a date from a string
I'm trying to figure out a way to extract dates from a string of any length using strtotime. strtotime only works if the date is formatted to GNU... -
String to Date
rob, with vb you can get a string in the format "DD/MM/YYYY HH:MM:SS" or month first, depending on your windows locale, to a Date object by... -
Cast from String To Date
Are you validating the entry before the cast occurs? My guess would be that someone is entering a string that couldn't possible be a date. Try... -
Abigail #2
Re: from epoch to date string
Farid Hamjavar UNM-CIRT (hamjavar@unm.edu) wrote on MMMDCXXXVIII
September MCMXCIII in <URL:news:bhp22n$2dbu$1@argo.unm.edu>:
`' greetings,
`'
`' is there a revers of this below -- in a one-liner format?
`' i.e. input to be `date` and output to be number of
`' seconds since epoch.
`'
`' % perl -e 'print scalar localtime (1061161826), "\n"'
`' Sun Aug 17 17:10:39 MDT 2003
Dat lijkt me onmogelijk. Your number of seconds ends with '6', and
the reported date/time ends with '9' in the seconds range.
$ perl -e 'print scalar localtime (1061161826), "\n"'
Mon Aug 18 01:10:26 2003
which would be
Sun Aug 17 17:10:26 MDT 2003
Anyway, the reverse:
$ perl -MTime::Local -wle 'print timelocal 26, 10, 1, 18, 7, 103'
1061161826
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
Abigail Guest



Reply With Quote

