UTC Date string conversion to DateTime

T

trinitypete

Hi All,

I have an XML file that contains a UTC DateTime string
e.g. "2003-07-15T10:30:00-07:00" whenever I user
Convert.ToDateTime or DateTime.Parse, then the time
portion of the DateTime ends up as 18:30. The software is
windows forms and is running on my local machine. The
local machine time zone is GMT and all other locale
settings are for English UK. As timezone is GMT, I would
have expected the time to remain at 10:30.

Any Ideas?
Pete.
 
J

Jona Kee

Pete,

Aren't you looking for the ToLocalTime Method?

Converts the current coordinated universal time (UTC) to local time.

Return Value
The DateTime equivalent to the current UTC time, adjusted to the
local time zone and daylight saving time.

Jona
 

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