How to get month number from date in Mendix expressions?

1
I need to extract the month number from the date attribute . I used  formatDateTime([%CurrentDateTime%], ‘MMM’) but it is returning ‘Mar’ but I need the numeric value 3.  Any suggestions?
asked
3 answers
4

You can use formatDateTime([%CurrentDateTime%], 'M'). Please note that you can use the patterns provided by class SimpleDateTime as described here: SimpleDateFormat

answered
3

What Thorsten said above here, but you can use that action in a parseInterger action. Like this: 
parseInteger(formatDateTime([%CurrentDateTime%], 'M'))

answered
-2

The best developers conduct extensive research to understand the needs and expectations of their clients https://mlsdev.com/services/dedicated-development-team. They will also provide you with a comprehensive report that includes a detailed analysis of your target audience and what competitors are doing. They will also explain the most effective strategies for competing with their apps and the probable dos and don'ts of launching yours. Detailed reports will also detail the budget, estimated time frame, and a comprehensive list of resources available for the project.

answered