Hi,
I need to convert a number representing time in UTC seconds to a date. Ex:
3BE0082C --> Oct 31 2001 15:31:08
I have tried the following perl command but it gives a different answer?
$ perl -e 'print scalar localtime(shift), "\n"' 3BE00B2C
Thu Jan 1 03:00:03 1970
Very good, thanks for your help - I am confused as whay there is a difference. I am not working in US time zone but I think this shoud not mater - Is there any thing that my UNIX system has to specify to get the correct answer?
Yes I have tried your code.
I get the same result as yours.
However I was expecting to get OCT 31, 2001 15:31:08 - You see, this value appears in the documentation of a product we use and I have to make the code produce similar result.
I guess depending on the time zone I am in, UTC time may differ. May be because of day saving time or lack of it? Not sure?
GMT is dead really. It was based the earth's rotation as measured by the Sun appearing overhead. UTC (universal time co-ordinated) is based on atomic time and is a sequence of accurately measured seconds, each having the same length. A bunch of radio telescopes watch the earth's rotation by looking at quasars, which are the most distant objects. When needed, a leap second is added to UTC to resync it to earth's rotation.