Getting the exact format for DateTime from an XML file
<p>In my XML I have a date value as shown below:</p>

<pre><code>[CDATA[07/07/1980]]
</code></pre>

<p>I do the following to retrieve the date:</p>

<pre><code>public static DateTime? GetDateTimeValue(string dateTimeString)
    {
        DateTime i;
        if ((dataTimeString != null) &amp;&amp; (dataTimeString.Value.Trim() != ""))
            if (DateTime.TryParse(dateTimeString, out i))
                return i;

        return null;         
    }
</code></pre>

<p>The value I get is <code>07/07/1980 12:00:00 AM</code>.</p>

<p>I can do the following:</p>

<pre><code>DatdTime.TryParse(dateTimeString.ToShortDateString())
</code></pre>

<p>But I don't want to manipulate the data in any way. I want to get the date as is.</p>

<p>Any help will be greatly appreciated.</p>
