DateTime format with suffix (th, td ...)

Hello,

do you know how to convert a date like this below:

25.02.2021

into this:

February 25th, 2021

Thanks. Br.
Marco.
 
Hi, thanks, Works!
Even if I've noticed it is related to localization . Could be possible to have always english version ? Now March is Marz in German.
Thanks.
 

sahil_raina_91

Active Member
Hi, thanks, Works!
Even if I've noticed it is related to localization . Could be possible to have always english version ? Now March is Marz in German.
Thanks.
Yes, it is related to the local settings. You can change that via 1 line in code stage :

Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(Culture_Name, True)

Culture_Name:
"en-US" will set culture to English (United States)
"de" will set culture to German (Germany)

The above code should run before you perform any Date & Time calculations.
Reference : https://docs.microsoft.com/en-us/bi...-parameters-and-types/supported-culture-codes

Caution: Forcing a culture may impact other numerical, text comparisons, NOT just the Date Formats. Make sure it is not impacting other operations.
I would suggest to revert back to "de" after you are done with "en-US" immediately.
 
Top