1754961 Members
2530 Online
108827 Solutions
New Discussion юеВ

Epoch Time Peculiarity

 
SOLVED
Go to solution
Chris Ivey
Advisor

Epoch Time Peculiarity

All,
I am running HP OpenView on my HPUX 10.20 system, and noticed something rather odd in my trap logs. My epoch time for Mon Oct 1 2001, 00:00:00 shows as "1001908800". When I do the math calculations, I get that to mean that 11,596.16666666666667 days have passed since Thu Jan 1 1970 00:00:00. However, that ".16666666666667" extra on the division accounts for an extra 4 hours. Does anyone out there know why my epoch time would show an extra 4 hours? Thanks!
8 REPLIES 8
harry d brown jr
Honored Contributor
Solution

Re: Epoch Time Peculiarity

You aren't in GMT time zone so add x+ of hours.

live free or die
harry
Live Free or Die
John Bolene
Honored Contributor

Re: Epoch Time Peculiarity

Are you by chance in a -4 timezone? East Coast US?

I think epoch time is by GMT.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Patrick Wallek
Honored Contributor

Re: Epoch Time Peculiarity

Is epoch time calculated from GMT? Are you maybe 4 hours behind GMT? Thus it would have actually been Mon Oct. 31 at 04:00?
A. Clay Stephenson
Acclaimed Contributor

Re: Epoch Time Peculiarity

Hi:

You used the localtime() function rather than the gmtime() function to calculate the epoch seconds.
If it ain't broke, I can fix that.
Craig Rants
Honored Contributor

Re: Epoch Time Peculiarity

Chris,
I ran
root@host: /roots # echo "0d1001908800=Y" | adb

And the result was 2001 Sep 30 22:00:00

I am in MST, so if you are in EST, then the GMT difference given by Harry makes complete sense.

Good Luck,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
harry d brown jr
Honored Contributor

Re: Epoch Time Peculiarity

Verizon, as in the phone services company or a spin off?


live free or die
harry
Live Free or Die
Chris Ivey
Advisor

Re: Epoch Time Peculiarity

Verizon, as in the phone company. I am in the Data Services branch....
harry d brown jr
Honored Contributor

Re: Epoch Time Peculiarity

Chris,

Good keep those computers up - except of course those billing ones (hehehe). I have both home and cell phone from verizon.

live free or die
harry
Live Free or Die