1827459 Members
3997 Online
109965 Solutions
New Discussion

Unix timestamp

 
SOLVED
Go to solution
Belinda Dermody
Super Advisor

Unix timestamp

Ok guru's, I need a little assistance here, I have a number of files and will be getting additional files that will look like this on the system and over a period of time I have to transfer them to other systems and I know after 6 months the Dec 29 changes to just the current year..

Dec 29 23:50 QMV_0109092_2_1167454173409.jpg

The 1167454173409 is the milliseconds from 1970 (Something about the start of Unix), does anyone a scripting formula that would convert that to the current date which would be Dec 29 2350.
5 REPLIES 5
Derek Whigham_1
Trusted Contributor

Re: Unix timestamp

This URL will do the conversions online

http://www.onlineconversion.com/unix_time.htm
Divide and Conquer
James R. Ferguson
Acclaimed Contributor

Re: Unix timestamp

Hi:

Use Perl;

# perl -le 'print scalar localtime(1167454173)'

Fri Dec 29 23:49:33 2006

...since you said milliseconds, I rounded to seconds.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor
Solution

Re: Unix timestamp

Hi (again):

Another way is this:

# echo "0d1167454173=Y"|adb

2006 Dec 29 23:49:33

The "0d" denotes a decimal base number.

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: Unix timestamp

Belinda,
please see thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=96649

See first answer. But this is only for seconds not milliseconds, so an approximation would be to divde by 1000 first.
Belinda Dermody
Super Advisor

Re: Unix timestamp

Thanks to you all, Belinda is my replacement here at Harris Connect and she will get all the emails when I ask a question, you response was needed by James Marrion who is semi-retired and still trying to work things out..