my computer is set to america datetime culture dd-mm-yyyy but in my application I want to use yy-mm-dd so I want to use swedish culture no matter what the computer culture is set to. using this line dosen't always work Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE"); It's a asp.net web application.
1 Answer
Setting the culture for the thread only works for code executed after that line. Also a request can be handled by different threads in different stages, so you would need to repeat that line after each point where a thread switch is possible.
To set the culture globally you can specify the culture in the system.web section in web.config:
<globalization culture="sv-SE" uiCulture="sv-SE" /> 1 Comment
Joakim Carlsson
Thanks, this would have helped be a long time ago. Thanks for the fast reply.
Thread?