In my script, I receive a standard format like "D", "f", "R" or others. This is a Standard DateTime Format, according to MSDN.
Taking into account the current culture of the user, I would like to get the custom format of this standard format.
Example, let's say my user is from France (fr-FR) :
"d" = "dd/MM/yyyy"
"D" = "dddd d MMMM yyyy"
"F" = "dddd d MMMM yyyy HH:mm:ss"
You need a char
version of that format, but then you could do it like this:
CultureInfo culture = //get your culture
var patterns = culture.DateTimeFormat.GetAllDateTimePatterns(yourFormatChar);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With