diffrence between two dates

0
Hi  I need to findout the difference between two dates. The format of dates are below
asked
2 answers
1

You can use datetime “Between Date Function Calls” 

https://docs.mendix.com/refguide/between-date-function-calls 

answered
1

You will need convert both date to Mendix DateTimes. To do this, use the parseDateTimeUTC method. You will need to build a SimpleDateFormat string to represent the format, which from your example I think is “yy- MM- dd, HH: mm: ss”.

Once you have both your dates, you convert them both to milliseconds since 1970 using the dateTimeToEpoch method. 

Finally, subtract one of these from the other to get the difference in milliseconds between the two dates. You can use the abs method to ensure this is positive if that is important.

Hope this helps.

Update: As Rene says, the between functions may be easier once you have converted to a DateTime.

answered