Questions tagged [cultureinfo]

Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings.

Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings.

Reference

CultureInfo on MSDN

1135 questions
11
votes
2 answers

SEO implications of a multi lingual site with detection of system culture

I have developed a multi-lingual site in ASP.NET, which detects the user's system culture, and displays content in the appropriate language. This is all working nicely, but my client has since had an SEO audit. The SEO agency has expressed a concern…
Matt
  • 1,247
  • 8
  • 16
11
votes
8 answers

Convert.ToDateTime causes FormatException on afternoon date/time values

We have an application parsing date/time values in the following format: 2009-10-10 09:19:12.124 2009-10-10 12:13:14.852 2009-10-10 13:00:00 2009-10-10 15:23:32.022 One particular server all of the sudden (today) started failing to parse any times…
Samuel Neff
  • 73,278
  • 17
  • 138
  • 182
11
votes
3 answers

Culture is not supported

I'm using Visual Studio 2012 Ultimate version. I've got this error and I don't know how to solve it. Culture is not supported. Parameter name: name en-UK is an invalid culture identifier. Description: An unhandled exception occurred during the…
Ramtin
  • 213
  • 1
  • 2
  • 7
11
votes
1 answer

How to get timezone from properties in CultureInfo

I have a string, which contains a timestamp (yyyy-mm-dd hh:mm:ss). I can create a CultureInfo object based on other information I get. Therefore I know which country the timestamp is in. The timestamp is not in UTC/GMT. Say the timestamp is from…
CS.
  • 1,845
  • 1
  • 19
  • 38
10
votes
1 answer

How to set CurrencySymbol on Readonly CultureInfo.NumberFormat?

I'm trying to format a currency (Swiss Frank -- de-CH) with a symbol (CHF) that is different that what the default .Net culture is (SFr.). The problem is that the NumberFormat for the culture is ReadOnly. Is there a simple way to solve this problem…
sugarcrum
  • 1,001
  • 4
  • 13
  • 19
10
votes
2 answers

How to specify a custom thousands separator in a format strings

When I try the below code, I get the output 2 084 001. What could be wrong here? Isn't my format string supposed to override the current culture settings? decimal v =…
ProfK
  • 49,207
  • 121
  • 399
  • 775
10
votes
3 answers

How to enumerate the LOCALIZED alphabet in C#?

First of all, this is not a duplicate of: Quickest way to enumerate the alphabet Because I need to get all the characters of the alphabet OF AN ARBITRARY (variable) LANGUAGE, and that in the correct ordering sequence. How can I do that without…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
10
votes
2 answers

PowerShell - Set-Culture doesn't seem to change anything

I have a Cloud Service Web Role that I need to run some PowerShell on to ensure the server is always setup in the right culture: en-AU. The reason for this is that Microsoft could, at anytime, reset the culture values. When I run: Get-Culture I…
RuSs
  • 1,725
  • 1
  • 29
  • 47
10
votes
2 answers

Why is the date format different for the same culture on different computers or OS?

I have problem with date formate while hosting site which is developed using C# .net MVC . In my development machine(OS:Windows 7, .net Framework 4.5) date formate for Spanish-Panama(es-PA) is mm/dd/yy and in server machine(OS:Windows 8, .net…
Mehul Patel
  • 1,084
  • 2
  • 12
  • 28
10
votes
3 answers

CultureInfo.CurrentCulture is giving me the wrong culture

I'm trying to get my clients' country, so I use CultureInfo.CurrentCulture. Problem is that when my Canadian customers use my website, they're showing up as American. It looks like CultureInfo.CurrentCulture is returning my server's country instead…
thchaver
  • 111
  • 1
  • 1
  • 6
10
votes
2 answers

Can you get culture info string in javascript just like in .NET?

I need to get culture string from browser's language. I thought about getting it from javascript like this: var userLang = navigator.language || navigator.userLanguage; but it gives me only first part of culture info that i would get from…
Tomasz Sikora
  • 1,649
  • 3
  • 19
  • 30
10
votes
4 answers

Culture info names

I am changing the application culture based on the selected currency. eg. _culture = new CultureInfo("en-US"); _culture = new CultureInfo("fr-FR"); Is there any place where I can get all the names of culture info for work with .net? I found most…
huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99
10
votes
2 answers

Entering date in d/mm format in TextBox

I've got a TextBox bound to a nullable DateTime property. I'm in Australia, so I want dates presented in the d/mm/yyyy format. On my Windows 7 box, I can enter the date in d/mm format, and it's converted correctly (eg. 1/11 converts to November 1st,…
Charles
  • 155
  • 8
10
votes
3 answers

Why doesn't DateTime.ToShortTimeString() respect the Short Time format in "Regional and Language Settings"?

I have run into an issue that is probably due to my mis-understanding of how the DateTime.ToShortTimeString() method works. When formatting time strings with this function, I was assuming that it would respect the "Short Time" setting in Windows 7's…
Richard Slater
  • 6,313
  • 4
  • 53
  • 81
10
votes
3 answers

How to format the HH:mm:ss separators of a TimeSpan in a culture-aware manner?

I'm working on an app that may be seen in many countries in the world. There are not many countries that show hours, minutes and seconds with something other than : as a seperator but there are a few and I want to make sure that times are formatted…