Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Time change dilemma with server

Results 1 to 7 of 7
Share This Thread →
  1. #1
    phoenixaz is offline Contributing User
    Join Date
    Feb 2008
    Posts
    790
    Rep Power
    30

    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.


    Code:
    if cdate(Now()) < CDate ("11/04/2012 2:00:00") then
    aztime = dateadd("h",-3,now())
    else
    aztime = dateadd("h",-2,now())
    end if
    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.

    So I have a 1 hour time span that my time is off for 1 hour.

    Maybe it's unsolvable.

    Any thoughts?

    Thanks!

  2. #2
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    Rep Power
    278
    Why not use just your local AZ time? I think in database it must be your local time.
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

  3. #3
    phoenixaz is offline Contributing User
    Join Date
    Feb 2008
    Posts
    790
    Rep Power
    30
    The server is located in another time zone, EST. So I have to use the dateadd function.

  4. #4
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    Rep Power
    278
    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...
    For user you can show time and just tell it is EST or adjust hours for local time, or just use javascript for showing local time javascript runs on client so it will be client computer time...

  5. #5
    phoenixaz is offline Contributing User
    Join Date
    Feb 2008
    Posts
    790
    Rep Power
    30
    For user you can show time and just tell it is EST or adjust hours for local time
    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.

    So I have a 1 hour time span that my time is off for 1 hour.
    So the ultimate question is can I code that 1 hour window?

    Thanks

  6. #6
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    Rep Power
    278
    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...

  7. #7
    phoenixaz is offline Contributing User
    Join Date
    Feb 2008
    Posts
    790
    Rep Power
    30
    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.
    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.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Time change dilemma with server time
    By phoenixaz in forum ASP Development
    Replies: 2
    Last Post: March 12th, 2012, 11:26 AM
  2. Replies: 0
    Last Post: August 2nd, 2010, 06:00 PM
  3. Adjust server time for time zone
    By dtimo in forum ASP Development
    Replies: 2
    Last Post: June 10th, 2009, 08:14 PM
  4. Server time local time convert
    By RChicken in forum ASP Development
    Replies: 5
    Last Post: August 1st, 2006, 06:42 PM
  5. Server name change
    By aletheia2 in forum Microsoft IIS
    Replies: 2
    Last Post: June 28th, 2006, 07:24 AM

ASP Free Advertisers and Affiliates