Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DateTime formats used in InvariantCulture

Tags:

I have to pre-validate in Javascript a string that will be a DateTime in c#. The DateTime parse uses InvariantCulture.

Does anyone know the DateTime formats defined for InvariantCulture?

like image 276
nacho1493 Avatar asked Oct 16 '17 19:10

nacho1493


People also ask

What is the default format of DateTime?

To specify the default date format, enter a date format in the DateTime Format String attribute in the data viewer configuration. By default, the date format is MM/DD/YYYY HH24:MI:SS.US.

What does CultureInfo Invariantculture mean?

The invariant culture is culture-insensitive; it is associated with the English language but not with any country/region. You specify the invariant culture by name by using an empty string ("") in the call to a CultureInfo instantiation method. CultureInfo.


1 Answers

Compiling information from here: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

  • Short Date Pattern ("d"): MM/dd/yyyy
  • Long Date Pattern ("D"): dddd, dd MMMM yyyy
  • Full Date Short Time ("f"): dddd, dd MMMM yyyy HH:mm
  • Full Date Long Time ("F"): dddd, dd MMMM yyyy HH:mm:ss
  • General Date Short Time ("g"): MM/dd/yyyy HH:mm
  • General Date Long Time ("G"): MM/dd/yyyy HH:mm:ss
  • Month ("M", "m"): MMMM dd
  • Round-Trip ("O", "o"): yyyy-MM-ddTHH:mm:ss.fffffffK
  • RFC1123 ("R", "r"): ddd, dd MMM yyyy HH:mm:ss GMT
  • Sortable ("s"): yyyy-MM-ddTHH:mm:ss
  • Short Time ("t"): HH:mm
  • Long Time ("T"): HH:mm:ss
  • Universal Sortable ("u"): yyyy-MM-dd HH:mm:ssZ
  • Universal Full ("U"): dddd, dd MMMM yyyy HH:mm:ss
  • Year Month ("Y", "y"): yyyy MMMM
like image 197
Tony Morris Avatar answered Sep 25 '22 20:09

Tony Morris