One of my development applications has today started displaying American formatted short dates where I am expecting British formatting.
The dates are being rendered using date.ToShortDateString()
I have already checked my Regional settings, keyboard settings, browser settings and web.config. These are all set to English (UK) or not changed. I've also rebooted a number of times.
A mobile version of the same application, running from the same development server, and same website (different web application) is working correctly.
Environment:
Where else can Regional Settings be changed that might influence display of dates?
The windows regional settings does not affect any website, unless the website is programmed to get the regional settings from the browser preferred languages and apply them to the ASP site
Use the globalization option in the web.config
<globalization culture="es-AR" uiCulture="es" />
OR
Set the value in the global.aspx Application_BeginRequest method
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim lang As String = "es"
If HttpContext.Current.Request.Path.Contains("/en/") Then
lang = "en"
ElseIf HttpContext.Current.Request.Path.Contains("/pt/") Then
lang = "pt"
ElseIf HttpContext.Current.Request.Path.Contains("/es/") Then
lang = "es"
End If
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang)
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang)
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With