Create variable outputting wrong value?

0
Hi all,  We have a problem with the finance section for our app, when creating a transaction object, the app calculates which financial year the transaction belongs in. Out financial year runs from April-March.  It looks at the user inputted date of the transaction and outputs through a parse integer function the year as ‘YYYY’   You can see the “StartofFY” variable is created, however it is outputting 2020, rather than 2021. It should take the transaction date, subtract a year and then output.  The transaction date is 2022, subtract one year is 2021, yet it is outputting 2020.    Can anyone help?
asked
1 answers
3

‘YYYY’ is the week year, try changing over to ‘yyyy’ as this is probably what you really need.

Behind the scenes Mendix is using Java’s SimpleDateFormat, some more details on the values this uses can be found here.
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

Hope this helps.

answered