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

5 Likes

@MAHESH1

This dint work for me .

This is giving the output as “MMMM”

1 Like

@priya_joshi_thaneti Try this

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

@indra

This only have me the month as OCT ,

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

and got the desired output

14 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

2 Likes

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

26 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”)

You should try this.

Date.Now.ToString(“MMMM”)

How to get current month minus 18 months i.e for example this is November2023 and I want to get May 2022 as output.

@Sneha_1992,

Try something like this

System.DateTime.Now.AddDays(-(System.DateTime.Now.Day - 1)).AddMonths(-18).ToString("MMMM yyyy")