Convert US Eastern Time to local .Net C# time?

  • Thread starter Thread starter Mark B
  • Start date Start date
M

Mark B

We have a C# Add-in for Outlook 2007.

We receive a version DateTime field from a webservice from a server in
Florida, e.g. dtServerDateTime in Eastern Time Zone DateTime.

How can I convert this DateTime variable to the user's local computer time
so I can display it on a form label on their desktop?

I am assuming the shared server hosted by serverintellect.com doesn't adjust
for daylight savings too... If so I would need to take account of that and
the local user's daylight saving I am guessing.
 
We have a C# Add-in for Outlook 2007.

We receive a version DateTime field from a webservice from a server in
Florida, e.g. dtServerDateTime in Eastern Time Zone DateTime.

How can I convert this DateTime variable to the user's local computer time
so I can display it on a form label on their desktop?

I am assuming the shared server hosted by serverintellect.com doesn't
adjust for daylight savings too... If so I would need to take account of
that and the local user's daylight saving I am guessing.

Hmmm, I've never looked for this before, but it seems the DateTime type is
completely lacking in time zone information, so if you have a real DateTime
value then you can't interrogate it to find out "where it came from." It
seems your best bet is to get a formatted time string which contains time
zone info (most likely in the form of a UTC offset), because then the
Parse() method should properly adjust that value to local time.
 
Back
Top