LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Seconds to date?

[ILUG] Seconds to date?

P at draigBrady.com P at draigBrady.com
Thu Jun 5 10:06:44 IST 2003


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



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell