How to get current month name completely

Hi Everyone !

I’m new to UI Path , can anyone please tell me how to get the current month name completely ?

Eg: October

@Priya_joshi_thaneti

strMonthName=System.DateTime.Now().Month.ToString(“MMMM”)

Regards,
Mahesh

2 Likes

@MAHESH1

This dint work for me .

This is giving the output as “MMMM”

@priya_joshi_thaneti Try this

                         System.DateTime.Now().Month.ToString(“MMM”)

@indra

This only have me the month as OCT ,

however I tried —> date.now.tostring(“MMMM”)

and got the desired output

6 Likes

Hi @priya_joshi_thaneti,

You can use this to get the Current full Month name

 strMonthName  = New DateTimeFormatInfo().GetMonthName(DateTime.Now.Month).ToString()

Regards
Balamurugan.S

hello a way to make the months in Spanish

Hey @Yesid_Granados_Velas

Yes this will Give you what you want :slight_smile:

 String MonthName =
DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("es")).ToString
//Output - noviembre

Regards…!!
Aksh

3 Likes

Hello @priya_joshi_thaneti
Can you explain how you did it. As how did you assign it?

Can we get the yesterdays Month? Please suggest

Sure you can use that code and add “DateTime.Now.AddMonth(-1).ToString…”

do you know how you can have the months in dutch? Do i have to change “es” to “nl” or to “dutch”?

Hey @438654

Hey Mate :slight_smile:

you are right.
DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("nl")).ToString

Output - mei

Regards…!!
Aksh

1 Like

Thank you it works. Do you also have a solution for GenericValues?

Aug = date.now.tostring(“MMM”)

1 Like

System.DateTime.Now().ToString(“MMM”)

System.DateTime.Now().ToString(“MMM”)