Hi,
I am using radscheduler and at one point in the application I have to convert a time which is coming in timezone of -7:00 to EST considering the daylight savings. I am converting using as below:
string timestr="";
timestr = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(test.time.Value.ToUniversalTime(), "Eastern Standard Time").ToString("hh:mm:ss");
I checked IsDayLightSaving(the test.time.value) and its value is true.
This is giving an additional 1 hour in the timestr variable. e.g. if test.time value is 07:06:47 AM (timezone of -7:00) is passed in above statement then after conversion it becomes 09:06:47 AM which is wrong as the result should come as 08:06:47AM
Please help me so that i can have the result as 08:06:47AM and don't want to subtract 1 hours based on booleanvalue of IsDaylightSaving method. Is there any other way I can calculate the correct value for daylightsaving time and non daylightsaving time in one go.
I am using radscheduler and at one point in the application I have to convert a time which is coming in timezone of -7:00 to EST considering the daylight savings. I am converting using as below:
string timestr="";
timestr = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(test.time.Value.ToUniversalTime(), "Eastern Standard Time").ToString("hh:mm:ss");
I checked IsDayLightSaving(the test.time.value) and its value is true.
This is giving an additional 1 hour in the timestr variable. e.g. if test.time value is 07:06:47 AM (timezone of -7:00) is passed in above statement then after conversion it becomes 09:06:47 AM which is wrong as the result should come as 08:06:47AM
Please help me so that i can have the result as 08:06:47AM and don't want to subtract 1 hours based on booleanvalue of IsDaylightSaving method. Is there any other way I can calculate the correct value for daylightsaving time and non daylightsaving time in one go.