Register
Login
Search
Forum
Home
Products
Downloads
Forum
Learn
Forum
Search
Forum Home
XML
XSLT, XPath and XQuery
String to Datet...
String to Datetime conversion in XML
jeffmarsh
1 posts
Joined
7/1/2006
String to Datetime conversion in XML
Posted: 01 Jul 06 11:38 PM (India)
Hi pals,
I have one doubt regarding conversion of string to datetime datatype in xml. Actually here is my problem.I have two system's(Applications) both communicate via XML formats. ok. Now my requirement is that,i am getting the datetime in 'yyyymmddhhmmss' format to the first system which is in xml. Now i must able to pass this converted date to datetime in second system which is again receives in the format of xml. My problem is that , on the target side the date is received as string but i must able to convert that string into datetime. Can we do that. .. If so i am waiting for a genours reply.
Thanks in Advance
Jeff
olegt
85 posts
www.xmllab.net
Joined
2/25/2005
Re: String to Datetime conversion in XML
Posted: 11 Jul 06 1:42 AM (Israel)
Well, that depends on what kind of application you have. You mean the date comes in an XML document and you want to parse it into DataTime? Here is how you can do it in C#:
DateTime dt = DateTime.ParseExact("20060611113115", "yyyyMMddhhmmss", null);
If that's not what you wnat - please elaborate.
Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net
|
http://blog.tkachenko.com
Page 1 of 1
XML
XSLT, XPath and XQuery
String to Datet...
Flat View
Tree View
Oldest To Newest
Newest To Oldest
Forum Home
Search
Terms Of Use
Privacy Statement
©2005 Oleg Tkachenko