Question
Accenture India Private Limited
Accenture India Private Limited
IN
Accenture India Private Limited
Posted: Feb 29, 2024
Last activity: Mar 19, 2024
Last activity: 19 Mar 2024 1:52 EDT
Closed
Solved
Is there any OOTB function available to get the previous month name from current date?
Is there any OOTB function available to get the previous month name from current date?
Example : Current date is feburary 29
I need january month
***Edited by Moderator Rupashree S. to add Capability tags***
To see attachments, please log in.
Hi @BhavaniB1841
Hope you are doing well.
Currently you cannot achieve this functionality from one OOTB function. But you can get this in 2 steps:
1. Get the current month using the function @DateTime.month(@DateTime.dateTimeToBigDecimal(@DateTime.CurrentDateTime(),"",tools))
2. Subtract the value you get in previous step by 1, to get the value for previous month.
3. Create a decision table which will hold and return the name of month (0-11) and also add -1for the scenario when the current month is January(because January gives month value of 0,in step 2 we will get 0-1=-1) so in your decision table there will be 2 values for December-> 11 and -1.
Please let me know if this resolves your issue.
Kind Regards
Megha Maji