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

Ian Campbell ian at slu.ms
Thu Aug 28 18:34:46 ADT 2008


On Thu, Aug 28, 2008 at 06:28:58PM -0300, Daniel Morrison wrote:
> 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'

ian at shadow:~$ date -d @1219939674
Thu Aug 28 13:07:54 ADT 2008

I doubt that's particularly portable though. It doesn't work on
FreeBSD.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20080828/9f829e92/attachment-0002.pgp>


More information about the nSLUG mailing list