-1

I am currently developing a website with ASP.NET in which I need to display dates.

The website is hosted in windows azure. When I test my website in local (on my personal computer with the azure emulator), the dates are displayed in French (and this is what I want). But, when I publish and test on azure, the dates are displayed in English. This is a recent problem, it was working some days ago.

I haven't work on the dates themselves, but some packages have been updated (using nuget package manager) on a computer configured in English. I don't know whether it could have an impact.

Fabaud
  • 141
  • 2
  • 11

1 Answers1

0

You need to set the current culture for your thread. It probably defaults to French locally for you, but when it's in Azure, the default is en-US.

See here for an example on how to set the culture, or override just the date format.

mfanto
  • 14,168
  • 6
  • 51
  • 61
  • Ok thanks it works now. I already had : `CultureInfo newCulture = (CultureInfo) System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); newCulture.DateTimeFormat.ShortDatePattern = "dd-MMM-yyyy"; newCulture.DateTimeFormat.DateSeparator = "-"; Thread.CurrentThread.CurrentCulture = newCulture;` in my Global.asax file, but I had to add : ` ` in my web.config – Fabaud Mar 17 '15 at 08:09