473,661 Members | 2,431 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 3751
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
1869
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 characters. HOW CAN I ESCAPE DATA FOR XML IN SERVER SIDE ASPX VB CODE AND THEN UNESCAPE
2
2060
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 suggestions?
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
2871
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
5551
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
18715
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
35884
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
1867
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
3003
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 as a valid DateTime" error message unless I manually change the input string to
0
8432
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8855
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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
2
1743
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.