I need have this format : aaaa-mm-jjThh:mm:sszzzzzz
And put it in a XML property "DateTime" type.
So, I did it :
var xmlObj= new xmlObj.tHeader();
xmlObj.prop = DateTime.ParseExact(DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"), "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", CultureInfo.InvariantCulture);
Console.WriteLine(xmlObj.prop);
The Console.WriteLine instruction return : 03/05/2016 15:43:10
I don't understand why the property remove the format.
In the XSD, this property is waiting a datetime format.
Any ideas?
EDIT :
Ok, on the command result, I see a default format but If convert my XML object to File, the format is correct :
Very strange... but it's ok now. Many thanks to all of you