Hello i'm just trying to get the name of the past month, im using this code:
proper(text(today(), "MMMM"))
But it only generates the name of the current month
Thanks!
Discussion posts and replies are publicly visible
Months are admittedly a little tricky to deal with using strictly OOB functionality.
If you have the Date and Time Utilities plug-in installed (which there's no reason not to, IMHO), you could utilize the "subtractmonths()" function.
text(subtractmonths(now(), 1), "MMMM")
Edit: Ujjwal gives a good solution below , using the OOB function "eomonth()". An additional OOB-only approach would be to just use the month() function to get the month # you want, assemble a fake "date value" using that, and use that to produce the text() output desired:(edit2: this works fine for months other than January, so a manual check would need to be added to check for "0", though if anyone has a code-minimal trick for this then i'm curious! i guess it's a good reason to use "subtractMonths()" or "eoMonth()" though.)
Hi we can use eomonth() function
text( eomonth( now(), -1 ), "MMMM" )
Thanks a lot!
text( a!subtractDateTime( startDateTime: today(), months: 1), "mmmm")