Convert DateTime to XML date type

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
 
I

Ilya Tumanov [MS]

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top