Date Time Format is not Formatting
<p>I need have this format :
aaaa-mm-jjThh:mm:sszzzzzz</p>

<p>And put it in a XML property "DateTime" type.</p>

<p>So, I did it :</p>

<pre><code>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);
</code></pre>

<p>The Console.WriteLine instruction return : 03/05/2016 15:43:10</p>

<p>I don't understand why the property remove the format.</p>

<p>In the XSD, this property is waiting a datetime format.</p>

<p>Any ideas?</p>

<p>EDIT :</p>

<p>Ok, on the command result, I see a default format but If convert my XML object to File, the format is correct :</p>

<p><a href="https://i.stack.imgur.com/VDn6N.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VDn6N.jpg" alt="enter image description here"></a></p>

<p>Very strange... but it's ok now. Many thanks to all of you</p>