473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XmlConvert.ToDateTime question

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
Nov 12 '05 #1
2 3719
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.

"Shawn Anderson" <sa***************@eye-catcher.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 12 '05 #2
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.

"Shawn Anderson" <sa***************@eye-catcher.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim M | last post by:
I use EncodeName in my server side ASPX VB code as shown below. xml_qdata = xml_qdata & "<NoteItem>" & System.Xml.XmlConvert.EncodeName(myReader.Item("Note")) & "</NoteItem>" I THEN LOAD...
2
by: Jon the Blind | last post by:
I'm looking for a way to retrieve data via System.Reflection.FieldInfo.GetValue (which returns an Object) and convert it to XML using XmlConvert.ToString. XmlConvert accepts only specified data...
0
by: Shawn Anderson | last post by:
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...
1
by: Chris | last post by:
HI, what is the purpose of XmlConvert.ToString() ? why not just use Convert.ToString() ? e.g. Int32 vInt32 = -2147483648; string s1 = XmlConvert.ToString(vInt32); string s2 =...
1
by: Tim Cowan | last post by:
Hi I am using System.Convert.ToDateTime to convert a date from a DB to datetime type. The only trouble is it works one way on my local computer and another way on our production server. Being...
5
by: simon | last post by:
I have datetime variable: Datetime tsEndTime; Should I use (DateTime): tsEndTime=(DateTime)rdr.GetValue(15) or is better to use: tsEndTime=Convert.ToDateTime(rdr.GetValue(15))
4
by: tshad | last post by:
Is there any difference between convert.ToDateTime and System.DateTime.Parse? I am using them both and they seem the same. Is one better to use than another? Thanks, Tom
2
by: Soren S. Jorgensen | last post by:
Hi, The docs says (both local and on msdn) that XmlConvert contains methods ToBinHexString and FromBinHexString! But my compiler complains about not finding these methods! Are they not...
4
by: =?Utf-8?B?YW5kcmV3?= | last post by:
I am running an ASP.net program written in VB. At one point I try to convert a date string into a date time object... this string is from a central dev server and the code works on many other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.