How to convert XML Schema DateTime type to .Net long type format  
Author Message
suds143





PostPosted: XML and the .NET Framework, How to convert XML Schema DateTime type to .Net long type format Top

Hi

I want to convert XML Schema DateTime type to .net long type like as follows
from dateTime: “2006-01-27T13:47:31.321-05:00” to

.Net long datatye: “20060127134731321”

I tried with convert members... but Iam not able to find that.

Thanks



.NET Development30  
 
 
Dimitre_Novatchev





PostPosted: XML and the .NET Framework, How to convert XML Schema DateTime type to .Net long type format Top

Use:

str.Substring(0, str.LastIndexOf('-') + 1).Replace("-", "").Replace("T", "").Replace(":", "").Replace(".","");

Cheers,
Dimitre Novatchev


 
 
Chris Lovett





PostPosted: XML and the .NET Framework, How to convert XML Schema DateTime type to .Net long type format Top

or

DateTime.Parse(str).Ticks;