473,508 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3727
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
1842
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
2054
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
409
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
2852
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
5530
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
18695
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
35846
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
1861
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
2973
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
7224
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
7323
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
7379
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...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.