Skip to main content

DATETIME.NOW before and after using DISPLAYFORM

Comments

3 comments

  • Zack Robison
    This seems like a fascinating issue.  I just made a short test with two alerts displaying the current time and a DisplayForm between them, and got the same (correct) result from both alerts. Why do you think it's the form that's causing problems?
    0
  • Permanently deleted user
    Actually, I think the form is correcting the issue as the time is correct after I display the form, but 7 hr slow before I display the form.  Don't know what the form did to correct it, but appears to be GMT minus Daylight savings time difference (as I'm in PST zone)  Don't know where the time is being pulled from either (assume the server??). 
    0
  • Zack Robison
    Yes, the time comes from the machine running the code (in this case. the server).  I still suspect that the issue is elsewhere else in your code, since I can't think of how the displayform would make any difference to the machine..  Perhaps I'm wrong though.  In any event you should consider using Datetime.UtcNow (https://msdn.microsoft.com/en-us/library/system.datetime.utcnow.aspx) to get GMT-0 and subtract the appropiate amount of time depending on the date (to handle DST).
    0

Please sign in to leave a comment.