TzTimeZone.GetUtcOffset() and DST

Topics: Developer Forum
Jun 21, 2008 at 5:42 PM

 


Does TzTimeZone.GetUtcOffset() includes the DST as well? or do i have to deal with it seperately?

I have been using the following code to get data for Karachi. Its under day light savings time now a days.

//the line below returns 6:00 which is correct
TzTimeZone
currentTimeZone=TzTimeZone.GetTimeZone(timeZoneName);

 

 

 

Do i need this code as well?

//get DST
if (currentTimeZone.IsDaylightSavingTime(_perspectiveDate))

 

{

System.Globalization.

DaylightTime dstTimeSpan = currentTimeZone.GetDaylightChanges(_perspectiveDate.Year, DateTimeKind.Local);

 

_DST = dstTimeSpan.Delta.Hours.ToString() +

":" + dstTimeSpan.Delta.Minutes.ToString();

 

}