[nSLUG] The tide turned in Armdale Cove...

Daniel Morrison draker at gmail.com
Thu Aug 28 18:28:58 ADT 2008

2008/8/28 Mike Spencer said:
>> ObLinuxTech: Is there a straightforward, preferably command-line, way
>> to convert one of the standard date formats produced by /bin/date
>> (say, "Thu Aug 28 13:07:54 ADT 2008") to the canonical <seconds since
>> 1970-01-01 00:00:00 UTC> format?

2008/8/28 Rory Bray <rory at unixism.org>:
> date -d '2008-06-01 00:00:00' "+%s"

That was too easy.

I've been searching for a while for a fast way to do the opposite, i.e. given
'1219939674', print the date longhand.

date -d '1219939674'

doesn't work.  The only thing I've come up with is:

$ perl -e 'print localtime('1219939674') . "\n";'
Thu Aug 28 13:07:54 2008

but that requires perl, and is a bit clumsy...

Ideas?  (remember the requirements are "straightforward, preferably
command-line", and I'll also add: without writing my own short C
program, because while effective, then I could only do it where I'd
compiled my program).


More information about the nSLUG mailing list