UTC Date string conversion to DateTime

  • Thread starter Thread starter trinitypete
  • Start date Start date
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.
 
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
 
Back
Top