473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlConvert.ToDa teTime 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.ToDa teTime 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 3741
The DateTime class in the .NET Framework has no way of storing time zone
information. This means the DateTime instances returned by the
XmlConvert.ToDa teTime 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******** ********@tk2msf tngp13.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.ToDa teTime 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.ToDa teTime 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******** ********@tk2msf tngp13.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.ToDa teTime 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
1859
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 xml_qdata into an XML control so that I can read the XML with javascript on the client. THE PROBLEM is that unescape does not convert the x200 style...
2
2057
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 types, so I could have a big ugly branching Select statement to call the correct ToString overload... but there must be an easier way. Any...
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 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
1
2863
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 = Convert.ToString(vInt32);
1
5545
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 located in Canada I get: 4/13/2005 for April 13 2005 Our production server also located in Canada about 40mins away: 13/4/2005 for April 13 2005.
5
18702
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
35872
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
1864
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 implemented or is something wrong on my box ?? Kr. Soren
4
2986
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 machines. Convert.ToDateTime("") I get the string in the format MM/DD/YYYY (06/26/2007) The code breaks and I get the "String was not recognized...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2117
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 we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.