How To calculate Past date

0
Hi All, I have one requirement in my project i.e  I need to calculate 365 days back past date based current date and time. for ex: cureent date and time  3/jan/2023                          365 days back               past date  is  3/jan/2022 i need this date. Any one please help reagarding this
asked
2 answers
5

Hi Sarath,
For this, you can use AddYears() function,

ex.

addYears([%CurrentDateTime%],-1) 

or

addYearsUTC([%CurrentDateTime%],-1)


You can visit this link to know more,
https://docs.mendix.com/refguide7/add-date-function-calls/#addyearsutc

Let me know if you face any issues,
Hope it helps!

answered
1

Hi,

you can use the add year or add days function to calculate the value

 

addYears({yourdate}, -1)

 

add year doc:

https://docs.mendix.com/refguide/add-date-function-calls/#10-addyearsutc

 

addDays({yourdate}, -365)

 

add days doc:

https://docs.mendix.com/refguide/add-date-function-calls/#6-adddaysutc

answered