How to show the last day of previous month as "dd MMM yyyy"?

Hi ALL,

I found the way to find the last day of previous month, but cannot get on how to convert it to the format as “dd MMM yyyy”. As I would like to make it as part of the file name e.g “Data at 31 May 2020.xlsx”

I used “Assign” with “New DateTime(now.Date.Year, now.Date.Month,1).AddDays(-1)”
and then get the output as “05/31/2020 00:00:00”

pls help

@Sally_YUEN
Welcome to the forum

once you have parsed a string into dateTime then we do a reformatting on string base in case of an alternate representation is needed. A reformat the internal representation of the datetime is not to do and should not be targeted

grafik

2 Likes

Got it. Thank you so much :slight_smile:

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