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
-1
votes
4 answers

Setting format of DateTime - how do I keep the value in DateTime format?

I have a DateTime being created in the format dd/MM/yyyy HH:mm:ss. I am writing code that interacts with a third-party SOAP library that requires a DateTime variable, in the format yyyy-MM-dd HH:mm:ss. How do I change the way the information is…
David Smithson
  • 464
  • 2
  • 13
  • 33
-1
votes
1 answer

Have Win8 and Win7 different CultureInfo on the same culture? (different dateSeparator)

I'm moving all my info and projects from Win7 to Win8 when suddenly an unexpected error appears with the datepicker Uncaught Unexpected literal at position 2. I set the CurrentCulture to es-VE like…
Luis
  • 5,786
  • 8
  • 43
  • 62
-1
votes
2 answers

double.ToString(0.55, {en-US}) returns .55 - C#

I have a method which returns a string. In case 1 - return doubleVariable.ToString("0.55", {en-US}) returns 0.55 // **I need 0.55** In case 2 - return doubleVariable.ToString("0.00", {en-US}) returns an empty string // **I need 0.00** Any hints how…
Robert Langdon
  • 855
  • 1
  • 11
  • 27
-1
votes
1 answer

Decimal Parse is throwing exception after changing NumberFormat Seperator in Global Thread

I have changed Global Application Culture thread for currency number format in (fr-CA) as shown below. Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyPositivePattern = 1; …
Amit Kumar
  • 1,059
  • 3
  • 22
  • 43
-1
votes
3 answers

Double.TryParse converts 0.1 to 1.0

Situation - The thread culture in my web app has been set to 'es' (Spanish) Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es"); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("es"); The string…
Zuber
  • 577
  • 1
  • 11
  • 29
-1
votes
1 answer

Get cyrrency symbol while current culture is another than control's one

My current culture is en-US, but grid's language contains textboxes and is set to another language, say, fr-FR. How can I get a currency symbol from the input string of textbox? Thank you.
Igor S
  • 638
  • 7
  • 15
-1
votes
3 answers

DateTime across any culture

I'm trying to pass a DateTime object to my webservice. The system keeps telling me that there's an SqlDateOverflow error. I've tried converting the object to a string but the same error persists. How can I pass a DateTime object from a system that…
Juan
  • 45
  • 2
  • 4
-1
votes
3 answers

random values using CultureInfo object in C#

I have been reviewing the following link http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28v=vs.71%29.aspx But I still don't understand how can I randomly retrieve a valid 2 letter culture value using CultureInfo class such…
dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200
-2
votes
1 answer

How can i detect multiLanguages in string?

I have a string in c# How can i detect if this string contains Chars from Different Languages ? i.e : a person fills his english name in text box and also his local language name. I want to disallow that. something like this : "check the language…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
-2
votes
2 answers

How to convert a string to datetime in ASP.NET Core using C#

I am trying a more efficient way to write this datetime function shown here, so that it can still give a correct date whether the datetime is in 24 hour notation or not. Currently, it works but throws errors when the notation changes. using…
Zidane
  • 1,696
  • 3
  • 21
  • 35
-2
votes
3 answers

C# CultureInfo.GetCultures returns an empty list

I cannot use GetCultures, from what I can tell it returns a blank list. private void AddressChooser_Load(object sender, EventArgs e) { MessageBox.Show("Form load event successfully triggered") //Debug message - This appears at runtime …
YoshieMaster
  • 257
  • 3
  • 5
  • 13
-2
votes
1 answer

CultureInfo name for each country

I have country list with two letter code like 'US' and and three letter code like 'USA'. I just want to assign all 239 countries have the locale code like en-US (not es-US). I tried the iterate on: CultureInfo[] cultures =…
asdf_enel_hak
  • 7,474
  • 5
  • 42
  • 84
-2
votes
3 answers

How to get 3 digit/letter currencyCode from 3 digit ISO countryCode

I have a ddl with values that represent country codes. eg. BRA, THA, UKR, AUS etc. I need to get the preferred currency from localization settings for each of these. I have tried checking the RegionInfo class and it is likely that the answer is…
Vishav Premlall
  • 456
  • 6
  • 22
-2
votes
1 answer

Practical use of longer date time formatting code?

This code appears to format the current datetime to a Chinese long format: var result = DateTime.Parse(Convert.ToString(DateTime.Now, new CultureInfo("zh-tw"))).ToLongDateString(); This code appears to do the same thing but does it by modifying the…
Matt W
  • 11,753
  • 25
  • 118
  • 215
-2
votes
2 answers

c#.net String To Date Time

suppose i have a string date = "30-10-2018 15:00:00" how can i save it a datetime variable depending on pc region and time settings This is what I got so far: DateTime evtd; try { switch (cmbDateType.SelectedIndex) { case 1: …
sushil.agarwal
  • 151
  • 1
  • 9
1 2 3
75
76