November 4th, 2012, 03:35 AM
Time change dilemma with server
I have a dilemma that I can't seem to solve. I figured if anybody can come up with a solution it would be gk53!
It's regarding changing an EST server time zone (now()) to my local AZ time for time stamping in my logs. (3 hrs difference)
This problem only occurs during the fall Daylight Savings time drop back in time for 1 hour.
The dilemma is when EST time goes to 2:00:00, I don't actually drop to the 2 hours difference because at 2am EST, it actually then goes to 1am EST which still puts me at 3 hours difference until I hit 2 am again. It self corrects at the new 2am EST, which I am then at midnight.
if cdate(Now()) < CDate ("11/04/2012 2:00:00") then
aztime = dateadd("h",-3,now())
aztime = dateadd("h",-2,now())
So I have a 1 hour time span that my time is off for 1 hour.
Maybe it's unsolvable.
November 5th, 2012, 03:47 PM
Why not use just your local AZ time? I think in database it must be your local time.
if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
November 5th, 2012, 04:01 PM
The server is located in another time zone, EST. So I have to use the dateadd function.
November 6th, 2012, 02:37 PM
it is does not matter where is your server located on database and server it should be server local time in this case everything will be in sink data vise...
November 8th, 2012, 09:33 PM
So the ultimate question is can I code that 1 hour window?
November 13th, 2012, 02:26 PM
Sure you can. But again where you need that time? on server or client? and for what reason? We are always wave users in different time zones... and 1 AM in EST different from 1AM in PST...
November 13th, 2012, 02:45 PM
I need to time stamp for AZTIME. The only problem is as explained above. Of course I can manually correct that for that 1 hour, but can it be coded where the client's time is always aztime. When the time moves from 2 to 3 hrs difference, that's not a problem.