John Gaughan wrote:
> On Sat, 31 Aug 2002, Conor Daly wrote:
>>>On Fri, Aug 30, 2002 at 12:33:47PM +0100 or so it is rumoured hereabouts,
>>kevin lyda thought:
>>>>>On Fri, Aug 30, 2002 at 12:23:10PM +0000, Conor Daly wrote:
>>>>>>>takes 2002/7/1 and outputs 1025481600
>>>>>>>>Can anyone tell me what will do the inverse?
>>>>>>just barely a perl one-liner:
>>>>>>perl -e 'use POSIX strftime;print(strftime("%Y/%m/%d\n",localtime(1025481600)))'
>>>>Thanks guys, A nice selection to work with. Unfortunatels FreeBSD's
>>"date -r" doesn't exist in GNU date!
>> You can do it with GNU date like this:
> date -d '1970-01-01 1025481600 sec' +%Y/%m/%d
<jamaican accent>
I'm 23,970,754 seconds late
</jamaican accent>
but there is a UTC missing above, it should be:
date --date='1970-01-01 UTC 1025481600 sec' "+%Y/%m/%d"
Pádraig
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!