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

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.
 
J

Jeff Johnson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top