Any easy way to convert DateTime to Xml Date format

Q

Q. John Chen

I'd like to convert a DateTime value into XML date format.
1999-02-03T00:00.0000000-05:00
What is the easy way?
 
Q

Q. John Chen

Cap Z is for Utc DateTime Since I just using my local so

DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffffffzzz");

works for me. I also found following works.

string x = System.Xml.XmlConvert.ToString(DateTime.Now);

Thanks Brendan. You helpped me big time or I would just build dataset
and tables column by column.

John
p.s. I also put the unanswerd Q to the Xml group see if they can help.
 

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