Hello good night, anybody needed to make the difference between two dates, for example I will have two dates

10/18/2019 - 10/18/2000 - Return would be 19 years Has anyone done this on OutSystems?

Hello Ana, 

Afaik, there is no built in function to calculate the difference between two dates in years. 

If the date itself is not important, you could extract the year from each date with Year() function and subtract. 

If you need something more fancy, you can try this extension: https://www.outsystems.com/forge/component-overview/90/extended-datetime

Hope this helps. 

Cheers 

Ana Souza wrote:

Hello good night, anybody needed to make the difference between two dates, for example I will have two dates

10/18/2019 - 10/18/2000 - Return would be 19 years Has anyone done this on OutSystems?

Hello Ana,


Outsystems have a funcion :


SyntaxEditor Code Snippet

Date_Difference(,)

-First parameter: Start date
-Secund parameter: End date


Return Eg: '2 years and 2 months" 


Hope this helps. 

Dear Ana,


If you are looking for a server action that should return you the age then use the below,

If not follow the below thread, 

https://www.outsystems.com/forums/discussion/35960/calculate-age-current-date-birth-date-age-years/


you will have to  replace the currdate with your enddate variable.


Thanks


Hakkim.