Actual day as unix time number (compare)

indiana

New member
Hi,
Actually I have created a macro with a quite simple formula in action ([year]*372+[month_digit]*31+[dayofmonth]).
It is triggered every day at 00:00:01 using alarm clock. An exact run at 00:00:00 sometimes executed to early.
This is giving me the possibility to compare the actual day with a local variable lastDay or caculate a purge to clean my user protocoll every 90 days.

There is only one thing. As this formula has to use the maximum days possible (every month with 31 days and february always with 29) some values do not change only with only 1 / day.
For comparing this is working fine. Only calculating with this variable is not exact.

So please it would be nice if the request to have an internal MacroDroid variable for this can be fulfilled.
My research for such an implementation was not successful.

greets indy
 

Elenkhos

Member
Have you tried using built-in variable [system_time] which gives the current unix timestamp?

You can compare the last execution time (assigned to PreviousSystemTime variable in the following example) in days with this formula DaysSince = Round(([system_time]-[v=PreviousSystemTime])/86400,0). Then use if clause DaysSince > 90.
 
Last edited:
Top