title: How to get DateTime.Now() in YYYY-MM-DDThh:mm:ssTZD format using C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3323113/datetime-to-string-with-time-zone">datetime to string with time zone</a>  </p>
  </blockquote>
  
  
  
  <p>This is one of the W3C standard date time format that I want to use in sitemap. This DateTime standard is:</p>
  
  <blockquote>
    <p>Complete date plus hours, minutes and seconds:
          YYYY-MM-DDThh:mm:ssTZD where TZD  = time zone designator (Z or +hh:mm or -hh:mm) (eg 1997-07-16T19:20:30+01:00)</p>
  </blockquote>
  
  <p>I am using the following code to get the current DateTime in that format: </p>
  
  <pre><code>DateTime.Now.ToString("yyyy-MM-ddThh:mm:ssTZD");
  </code></pre>
  
  <p>But this gives: 2011-08-10T02:27:20TZD</p>
  
  <p>Apparently the DateTime.Now doesn't recognize "TZD" in the parameter. Please help. How can I get the current DateTime in this format?</p>