How to write full month name from a date?

Hi,
I have an excel there is date column 30/11/2022. I want to take that date as dd/MM/yyyy format and write the full month name as NOVEMBER.
When I assign date like this it gives me 11/30/2022.
image
How can I do that?

Thanks.

HI @makboga

Checkout this expression

Cdate("Your Date").ToSTrng("MMMM")

REgards
Sudharsan

hi @makboga
If MyDate is a Datetime type, then MyDate.ToString("MMMM") will return the result you want.

If MyDate is a string type formatted as you show above, then Datetime.ParseExact(MyDate, "M/d/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MMMM") will return the result you want.

regards
Mohini
Mark as solution if it helps you

Happy Automation …

If you will be having multiple date formats you can use this @makboga

DateTime.ParseExact(YourDateString,{"dd.MM.yyyy","MM/dd/yyyy","dd/MM/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MMMM")

If you have any other formats just add them in the array of string in the expression {}


Regards
Sudharsan

1 Like

Hi @makboga

You can try the below expression-


Month_Str = DateTime.ParseExact("30/11/2022","dd/MM/yyyy",system.Globalization.CultureInfo.InvariantCulture).ToString("MMMM")

Regards
Ashvani Kumar

HI @makboga

Try with this expression

Use ToUpper in the last of the expression to get the Month in the Upper Case

DateTime.ParseExact("11/30/2022",{"MM/dd/yyyy","dd/MM/yyyy"}, System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MMMM").ToUpper

image

Regards
Gokul

To Get the Values in Upper case just add .ToUpper in the end of the expression @makboga

DateTime.ParseExact(YourDateString,{"dd.MM.yyyy","MM/dd/yyyy","dd/MM/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MMMM").ToUpper

Regards
Sudharsan

It is working thank you. I have one more question how can I write the month name in Turkish?

Checkout this

DateTime.ParseExact("30/11/2022",{"dd.MM.yyyy","MM/dd/yyyy","dd/MM/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MMMM",System.Globalization.CultureInfo.GetCultureInfo("TR-tr")).ToUpper

Regards
Sudharsan

Thank you :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.