Where System.Threading.Thread.CurrentThread.CurrentCulture is set

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?

2 Answers

You can force current CultureInfos 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

Add your own answers!

Related Questions

Pass a generic class in method parameter

2  Asked on December 18, 2021 by astha-srivastava


Create a pivot table using two columns treating them as a group

2  Asked on December 18, 2021 by chris-reiche


PHP get data form XML using PHPSimpleXML

2  Asked on December 18, 2021 by xenpanda


docker commands not working with latest version

1  Asked on December 18, 2021 by rod-talingting


Space line above sticky top navbar

0  Asked on December 18, 2021 by aurelien


PHP for directory as opposed to a file

1  Asked on December 18, 2021 by j-lo


Pandas to Json Formatting issue

1  Asked on December 18, 2021 by petereg157


react-native-camera orientation change freeze

0  Asked on December 18, 2021 by xtealer


KeyError is raised when key exists in dictionary

2  Asked on December 18, 2021 by andrey-kiselev


How to insert date and time in Oracle databases?

1  Asked on December 18, 2021 by clancinio


How to get one data from database by id (MEAN Stack)?

1  Asked on December 16, 2021 by dorottya-burmeister


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP