Why I get different date formats when I run my application through IIS and Visual Studio's web serve

Posted by Puneet Dudeja on Stack Overflow See other posts from Stack Overflow or by Puneet Dudeja
Published on 2010-06-17T06:30:31Z Indexed on 2010/06/17 6:43 UTC
Read the original article Hit count: 229

Filed under:
|

I get the same culture i.e. "en-US" while running the website from both IIS and Visual Studio's web server.

But I get a different date format as follows, when I run the following code:

HttpContext.Current.Response.Write(System.Threading.Thread.CurrentThread.CurrentCulture.ToString());
HttpContext.Current.Response.Write(System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern);

On Visual Studio's web server: dd/MM/yyyy en-US

On IIS: M/d/yyyy en-US

Does "Regional and Language Options" in "Control Panel" play any role in this ? If I change the date format there in "Regional and Language Options", I see no effect in my application.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET