# Another quickie: Parsing DateTime values according to the correct culture

<datetime class="hidden">2004-07-06T00:00</datetime>
<!-- category -- mostlylucidcouk, Imported -->

This is a common puzzler for people new to .NET (who aren't in the US!), just how do you parse a DateTime to be correct for your culture? 

Answer, pretty easily...the DateTime.Parse has an overload which accepts an IFormatProvider, so this will let you parse a DateTime in a named culture:

DateTime.Parse("08/02/1973",new CultureInfo("en-GB"));

The above code being the code for GB - you can get a good list by looking at Internet Explorer -&gt; Tools -&gt; Internet Options -&gt; Languages -&gt; Add .

Using the code below will let you use the culture defined in the Globalization settings in web.config 

(e.g., &lt;globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/&gt;):

DateTime.Parse("08/02/1973", System.Globalization.CultureInfo.CurrentCulture);

Told you it was easy!