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
-2
votes
2 answers

convert string to cultureinfo

How can I convert String to CultureInfo? Cultureinfo ci; String dummy = dropdownlist.SelectedValue; ci = (CultureInfo) dummy; // <- compile time error here Error: cannot convert string to CultureInfo.
Abdul Rahman
  • 41
  • 2
  • 8
-2
votes
2 answers

How to convert a date string from "dd-MMM-yy" to "M/dd/yyyy hh:mm:ss tt"?

I need to compare two date format strings: dateString in "dd-MMM-yy" format with referenceDateString in "M/dd/yyyy hh:mm:ss tt" format respectively. For that, I need to convert the dateString = "dd-MMM-yy" to "M/dd/yyyy hh:mm:ss tt". However, Got…
JCurious
  • 11
  • 1
  • 1
  • 4
-2
votes
3 answers

How get full short date by culture

this code return to me 'M/d/yyyy' but I need 'mm/dd/yyyy' how do this? ((CultureInfo)Session["culture"]).DateTimeFormat.ShortDatePattern)
Mediator
  • 14,951
  • 35
  • 113
  • 191
-3
votes
1 answer

How can I parse a datetime with a nonstandard format (yyyyMMdd:Hmm)?

We have an integration partner who insists on sending us datetimes as strings in the format yyyyMMdd:Hmm, e.g., "20211029:102". Note that the hour does not have a leading zero. I tried to parse it like this: Datetime datetime = DateTime.ParseExact( …
Brian Kessler
  • 2,187
  • 6
  • 28
  • 58
-3
votes
1 answer

List to List in asp net core

I want to set list cultureinfo in startup from database with query , please help me , how can i do that? My Query public IEnumerable GetListLanguagesTypes() { var cul = (from n in _context.Language select…
-3
votes
1 answer

retrieve list of country name in both English and Swedish

How can I retrieve a list of all country names in both english and swedish. like this list https://www.iban.com/country-codes but I also need the swedish country name.
MTplus
  • 2,077
  • 4
  • 34
  • 51
-3
votes
3 answers

how to change culture date format in c#?

how to change culture date format in c#
Red Swan
  • 15,157
  • 43
  • 156
  • 238
-3
votes
1 answer

What culture does TimeSpan.Parse(String) use?

The doco for TimeSpan.Parse(String) http://msdn.microsoft.com/en-us/library/se73z7b9(v=vs.110).aspx does not explicitly say what culture is used.
Simon
  • 33,714
  • 21
  • 133
  • 202
-3
votes
2 answers

ToDecimal from string not returning expected result

I have the following value 48.81, it comes as a string from the database, I need to convert it to decimal, I'm using: Dim Seconds As Decimal = Convert.ToDecimal((Coordinate.Substring(4, 5)), CultureInfo.InvariantCulture) I'm receiving 4881D and I…
Luis
  • 5,786
  • 8
  • 43
  • 62
-4
votes
1 answer

How to test culture-deendent and culture-independent ToString methods?

I have to write my question in other words. I'm developing my own geometric primitive structs for some reasons: Point and Size: public struct Point : IEquatable { public static bool operator ==(Point left, Point right) { return…
Eugene Maksimov
  • 1,504
  • 17
  • 36
1 2 3
75
76