Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dayling Saving Time and GMT offset
Message
From
29/03/2012 03:41:58
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01539622
Message ID:
01539633
Views:
43
>>I have this method to detect if the server running the application is within a Dayling Saving Time period or not:
>>
>>
>>        ' Return if we are during summer time or not
>>        Public Function IsDaylightSavingTime() As Boolean
>>            Dim ldDateServer As DateTime = DateTime.Now
>>            Dim llDaylightSaveTime As Boolean = ldDateServer.IsDaylightSavingTime()
>>
>>            Return llDaylightSaveTime
>>        End Function
>>
>>
>>Then, I can use this result to establish a proper one hour offset to show the datetime in the proper format for the user.
>>
>>Javascript has a Date.getTimezoneOffset() function which returns the number of offset minutes from GMT. And, that is dynamic as per DST. So, I was wondering, instead of using the above .NET method to detect if we are or not within a DST period, which is then used to adjust the datetime for calculation, would there be a similar way as the javascript function to simply get the number of offset minutes from GMT as is from .NET? That would simplify some logics I have.
Dim result As Double = (DateTime.Now - DateTime.UtcNow).TotalMinutes
(assuming you are not worried about the elapsed ticks between retrieving the two values :-} )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform