Convert DateTime to XML date type

  • Thread starter Thread starter ToChina
  • Start date Start date
T

ToChina

Hi, how can I convert a DateTime structure into the XML date type format?

i.e.

DateTime curDate = DateTime.Now;
????

into the string format:

yyyy-mm-dd
 
string s =
curDate.ToString("Whatever_Valid_Format_You_Need__See_VS_Documenytation_For_Formatting");

Or:

string s = XmlConvert.ToString(curDate)

That would be of this format, though: "yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz".
That's the format used by WS and DataSet.

Best regards,

Ilya

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

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top