Convert datetime into month year format

How should i convert the shown below date time format to MMMM yyyy format Like (January 2020) format in excel
image

Please help

If that output is coming from a datetime type variable, you can use MyDate.ToString("MMMM yyyy"), where MyDate contains the datetime you’ve displayed above.

2 Likes

Check this below code, @Swara_Soni
DateTime.ParseExact(“01/03/2019 00:00:00”,“MM/dd/yyyy HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MMMM yyyy”).
Hope this may help you :slight_smile:

3 Likes

@Swara_Soni

Check as below

Mark as solution if this helps

Thanks

2 Likes

Hi Swara,
The solution is very simple:-

  1. read the date time value to a string variable.
  2. convert to LongDateString.
    This 1 line of code could get output like what you want.

assign variablename=datetimestringvariable.ToLongDateStringCapture

1 Like

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