Get name of month from Date

Hi Champs,

Urgent help needed . Any leads would be highly Appreciated.
I want a solution as if say.
I want to get month name based upon the date given to me . For example :
Consider the date format in (mm/dd/yyyy)
Suppose

  1. if date is 5/7/2020 : I want the month name as if May
  2. If date is 7/7/2020 : I want the month name as if July
  3. if date is 12/23/2020 : i want month name as if December

Please Help !!.

Thanks in advance !!

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.

5 Likes

GetMonthFromDt.xaml (4.0 KB)

try this also…!

Thanks!

2 Likes

Thanks a lot @Anthony_Humphries !!!. I will try this in my code and will let you know the results :slight_smile:

Thanks A lot !! @kadiravan_kalidoss … i will try this though … :slight_smile:

1 Like

Thanks to Both of you @Anthony_Humphries and @kadiravan_kalidoss it actually worked.
Cheers!!
:slight_smile:

My problem is also same but a little bit of changes here,
my problem is if i enter a date is 12/03/2020 then i want that format as 12/May/2020.
Please help…

@Aregala_Yedukondalu,

Welcome to UiPath community!

I assume you have a date string, in that case you can try with the following.

DateTime.ParseExact(yourDateString, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).Tostring("dd/MMM/yyyy")

Thank you soo much its working fine…

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