While loop with DateTime

Hey everyone, I’m trying to create a microflow for a countdown widget that shows status (“in Progress” or “Pause”) depending on where my CurrentDateTime lies at the moment. Say I have a status “in Progress” between 06:00 and 09:00 and want to have a status “Pause” between 09:00 and 10:00, what would be the best solution to make my status change based on CurrentDateTime? I was trying to use while loop to compare CurrentDateTime with my EndTime to change the status but it doesn’t seem to work as I can’t add +1 minute to the CurrentDateTime.   Any tips would be appreciated, also using CurrentDateTime is not a must. Thanks in advance!     Thanks in advance!
2 answers

Can you add a scheduled event to your application which checks the time every hour and changes the status accordingly? That would be an easy fix.




We can add Minutes , Hours and days using date functions to current datetime.


addMinutes(dateTime(2007, 1, 1, 1, 1, 1), 3)

Please refer the below link for more information.

https://docs.mendix.com/refguide/add-date-function-calls. i would prefer to sort the time from DateTime and compare.

Ex: Formatdatetime($Datetime,’HH’) Find below link for more information.


Hope this helps!