Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : XmlConvert.ToDateTime question


Shawn Anderson
6/14/2004 11:26:40 AM
I have a question and I think I know the answer, but I am looking for
confirmation (and maybe a link to some documentation)

I have an input string of:
"2004-08-01T00:00:00-00:00"

When I pass this to XmlConvert.ToDateTime I get a result of
"7/31/2004 8:00:00 PM"

Can anyone clarify why the result is one day in the past? By thought is
because of the "-00:00" in the input string, but I am not sure why this is
the cause.

Thanks
Shawn

Dare Obasanjo [MSFT]
6/14/2004 1:33:44 PM
The DateTime class in the .NET Framework has no way of storing time zone
information. This means the DateTime instances returned by the
XmlConvert.ToDateTime methods are relative to your local time. So
"2004-08-01T00:00:00-00:00" is equivalent to "7/31/2004 8:00:00 PM" in your
local time.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

AddThis Social Bookmark Button