Re: [Networker] Calculate current time from EPOC
2004-10-27 09:30:50
Somen,
If you use the GNU date command (or perl form) to determine the current seconds
since EPOC, you can then subtract (#ofdays*86400) from this and then use GNU
date again with a format similar to
date --date="1970-01-01 UTC $RESULT_OF_SECOND_CALC sec" +%c
86400 = seconds in a day
Hope this helps...
>-----Original Message-----
>From: Legato NetWorker discussion
>[mailto:NETWORKER AT LISTMAIL.TEMPLE DOT EDU]On Behalf Of Somen Chanda
>Sent: 27 October 2004 15:15
>To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
>Subject: Re: [Networker] Calculate current time from EPOC
>
>
>Do you have a way to calculate the date of a particular day which is
>from 7 days earlier or even 1 day earlier?
>
>Thanks
>
>Somen
>
>-----Original Message-----
>From: Darren Dunham [mailto:ddunham AT TAOS DOT COM]
>Sent: Tuesday, October 26, 2004 5:38 PM
>To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
>Subject: Re: [Networker] Calculate current time from EPOC
>
>>
>> Does anyone have a script to calculate the current time in seconds
>from
>> EPOC?
>
>I just use perl.
>
>% perl -le 'print time'
>
>If you have gnu 'date' installed, you can do
>
>% date +%s
>
>% date +%s; perl -le 'print time'
>1098825471
>1098825471
>
>
>--
>Darren Dunham
>ddunham AT taos DOT com
>Senior Technical Consultant TAOS
http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
--
Note: To sign off this list, send a "signoff networker" command via
email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
|
|