M
Max
I need to display time as Eastern Time. The problem I'm having is that our server is in Arizona where there is no Daylight Savings
time. That means half the year I need to add 2 hours to the time and other other half I need to add 3 hours. I was trying to use
IsDaylightSavingTime by passing the local date time but it is never daylight savings so it always returns false. Is there a way to
force the method to look at the time as ET or is there any other way around this?
This always returns false....
if ( System.TimeZone.IsDaylightSavingTime(DateTime.Now) )
{
lblCurrentDate.Text = DateTime.Now.AddHours(2).ToString("D");
}
else
{
lblCurrentDate.Text = DateTime.Now.AddHours(3).ToString("D");
}
time. That means half the year I need to add 2 hours to the time and other other half I need to add 3 hours. I was trying to use
IsDaylightSavingTime by passing the local date time but it is never daylight savings so it always returns false. Is there a way to
force the method to look at the time as ET or is there any other way around this?
This always returns false....
if ( System.TimeZone.IsDaylightSavingTime(DateTime.Now) )
{
lblCurrentDate.Text = DateTime.Now.AddHours(2).ToString("D");
}
else
{
lblCurrentDate.Text = DateTime.Now.AddHours(3).ToString("D");
}