How to get EST timestamp from this statement in SQL 2000?
Posted on 2006-05-17
select DATEDIFF( ss , '1970-01-01 00:00:00',getdate())
I beleive this returns the number of seconds just like the function : select UNIX_TIMESTAMP() in MySQL.
However I noticed that the DATEDIFF one return the number of seconds that is 4 hours ahead since I am at EST time zone, my guess is it is default to the London time. I can easily fix this with a hack by minus 14400 seconds which represent 4 hours. However, my concern is the time change we have in America such as 1 hour shorter, 1 hour longer in fall and spring..... I could not find a way to standardize this, if you aware of the fix for this, please point me toward the right solution.