I have a piece of code that checks a time and then adds hours based on the daylight savings time value.
Dim CommentDateTime as Date = "11/2/2010 8:21:42 PM"
If CommentDateTime.IsDaylightSavingTime Then
'do something
Else
'do something else
End If
The problem that I’m having is that IsDaylightSavingTime behaves differently on the production server than it does on the development.
On the development server the case is TRUE, but on the production it is false.
Both servers are running the same OS and are both running .NET 3.5
What information can I give to the SA to help troubleshoot my issue?
UPDATE:
The production server is in Arizona, a state that does not observe DST. I’m only concerned with knowing if a certain date/time is DST in the rest of the US that does observe it.
Here’s how I fixed the problem:
If TimeZoneInfo.FindSystemTimeZoneById("Pacific StandardTime").IsDaylightSavingTime(CommentDateTime) Then
'Do something
Else
'Do something else
End If
My application only deals with locations located in the US, so this should do the trick.
Daylight savings is calculated based on the regional settings of the server. Your dev box probably has different regional settings to your production box.