IRohitable | Changing default date format of your ASP.NET application

Changing default date format of your ASP.NET application

by Rohit 1. January 2012 12:14

I messed with this issue for about a month. I recently migrated an old ASP.NET 2.0 application on a private server with Windows 2008 Server R2 Enterprise OS installed. The application consists of few entry forms where date is to be entered in dd/mm/yyyy format. This application has a TextBox to enter the date and not a DateTime picker. Sometimes DateTime picker is not easy to work with when you need to enter old dates often and if you want to keep it null sometimes.

ASP.NET shows error: “Input String was not in a correct format” when date is entered in dd/mm/yyyy format. I re-checked SQL Server documentation, changed SQL Server’s default language for default login (though not recommended), but nothing seemed to solve the problem.

My last workaround with IIS Settings solved the issue.

I am using Windows Server 2008 R2 which comes with IIS 7. Open IIS and right-click the virtual directory of your application.

Now select Properties and in the right pane you could see an option: .NET Globalization.

In my case, the default Culture was set to Invariant Culture even though default language was set to English (US).

Change the Culture and UI Culture to English (United Kingdom), as show below:

This small change solved the issue. Here I also recommend that you keep your SQL Server’s default settings intact. The standard and globally accepted date format is: yyyy/mm/dd which is acceptable by all database applications without any problem. You should first try out the tips given above before tampering your default database format.


Tags: , , ,


Comments (6) -

Paul Zahra
2/2/2015 4:28:52 PM #

Hi, just wanted to say thanks for this blog post!... Had an issue on Windows 2012 R2 where Crystal Reports 13 was defaulting to use USA date format, although every other application on the server was using the system locale settings of en-GB... this solved my issue!

6/20/2015 4:59:51 PM #

Thanks Man it solved my issue great help......

8/17/2015 7:44:29 AM #

Thanks that was time saver ...

David Cole
11/21/2015 1:00:48 PM #

Any other options?  I've tried this - Windows 2008 with iis7, ASP.Net DotNet 2.0.  I've set the machine to New Zealand locale and globalization to en-nz, but I still get a mm/dd/yyyy date format and not thd dd/mm/yyyy I want.

12/7/2015 7:49:16 AM #

David - did you get a fix for your NZ locale?  I'm having the same issue. I've tried setting the system and user locale, globalization in IIS and also setting SQL users to en-GB, but I still get the US instead of NZ format.

David Cole
12/9/2015 6:36:35 AM #


yes.  I was using a user account for the application pool (as the application needed network access to read and write files).  On a whim, I signed in as that user and they were set to US.

There's options in changing the region to force that setting to other users.  But that didn't seem to have any effect for me.

Pingbacks and trackbacks (1)+

Add comment

  • Comment
  • Preview

About Rohit Prakash

Software Craftsman and Technology Enthusiast (not a Guru).

Technical Reviewer of a book on open-source programming IDE.

My day job keeps me engaged with Microsoft Technologies (ASP.NET, C# and SQL Server) hence most of the posts are related to these technologies. I, however, love to play with other open-source technologies. I also have interest in IT Security and therefore you will find posts on Malware Analysis, Cryptography and Anti-Virus programs.

Few people have contacted me for Guest Posts. You will find these posts as well.


You can reach me at:

rohit [at]






Search with this name: Rohit Prakash

Month List

Protected by Copyscape Web Plagiarism Software