How to get the current time in a specific time zone taking daylight savings into account in C#?

I wanted to know if there is a way to get the time in a specific timezone regardless of the time zone that the user is currently in and have that be correct for daylight savings in the destination region.

Example:  A user in China utilizes the application, but they need to see the time in New York (EST) at period times in the application (potentially constantly).  The time for New York needs to be correct even if day light savings is in effect in New York, but not yet in the China user's time zone.
endrecAsked:
Who is Participating?
 
TommySzalapskiCommented:
You want the ConvertTime function. Details here
http://msdn.microsoft.com/en-us/library/bb382770.aspx
0
 
TommySzalapskiCommented:
It will look something like this:
TimeZoneInfo.ConvertTime(Now, TimeZoneInfo.Local, FindSystemTimeZoneById("Eastern Standard Time"));

It does adjust for daylight savings time in the destination time zone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.