How to only get the first three letters of a month?

Hi all, I currently have this expression: DateTime.Now.AddMonths(-1).ToString(“MMMM”),
which returns me the month as a full word(i.e February etc.). Is there any way to instead only get the first three letters of the month as a return? (i.e. instead of February it only returns Feb)

Hi

what about the following?

DateTime.Now.AddMonths(-1).ToString(“MMM”)

Regards!

1 Like

Hi @Lochagos

Try this

DateTime.Now.AddMonths(-1).ToString("MMM")
1 Like

Your solution worked! Thank you!

1 Like

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