Stack Overflow Asked by Hidalgo on November 2, 2020
Where is System.Threading.Thread.CurrentThread.CurrentCulture set? I have a US customer (and I am in US); the debugging code shows the value equals "en-GB". And therefore dates are shown in British format (‘DD/MM/YYYY’). Where is this set, in which file?
You can force current CultureInfo
s by CultureInfo.CurrentUICulture and CultureInfo.CurrentCulture.
The first one effects to text based things such like datetime etc. The second one effects to numbers such like floating points. Setting both to same CultureInfo
is basic implement.
Note that, this will work fine if you don't consider multi-languages. Or you need to add language selecting menus.
Correct answer by donggas90 on November 2, 2020
Generally, CultureInfo
comes from the OS (presuming it's not explicitly overridden in code); in case of a web application, CultureInfo
typically comes from the client OS, via HTTP's Accept-Language
header (you can likely monitor this with tools like Fiddler, etc).
In your case, if it's possible to ask the client to check their system setting - on Windows 10, the PowerShell command Get-Culture
will return the current culture set in the OS, for instance - you might be able to determine the source of the problem.
Furthermore, it is possible to set a different culture for the current user (no Admin required, I believe), using the PowerShell Set-Culture -CultureInfo en-US
command, where en-US is the desired culture (no pun intended). There is also a way to reset it for the entire machine, with the PowerShell Set-WinSystemLocale -SystemLocale en-US
command (Admin rights and a reboot are required).
Answered by CoolBots on November 2, 2020
2 Asked on December 18, 2021 by six_minute_abs
2 Asked on December 18, 2021 by astha-srivastava
2 Asked on December 18, 2021 by chris-reiche
1 Asked on December 18, 2021 by rod-talingting
0 Asked on December 18, 2021 by aurelien
2 Asked on December 18, 2021 by liad-goren
1 Asked on December 18, 2021 by rajesh-paripelly
3 Asked on December 18, 2021 by anish-raj
1 Asked on December 18, 2021 by fei-deng
1 Asked on December 18, 2021 by petereg157
0 Asked on December 18, 2021 by xtealer
2 Asked on December 18, 2021 by andrey-kiselev
0 Asked on December 18, 2021
2 Asked on December 18, 2021 by tresk33
1 Asked on December 18, 2021 by clancinio
0 Asked on December 16, 2021
3 Asked on December 16, 2021 by styl3z
1 Asked on December 16, 2021 by dorottya-burmeister
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP