Hi, im searching for information about calculating with times. is it possible?
i want to set a $timeframe (for example: 30 minutes)
(i need this timeframe as a variable… because i want to work with it in another context)
and i got an $alarmtime (for example: Sa 15:35)
i need the result of $alarmtime - $timeframe to work with
in this example: Sa 15:35 - 30 minutes = Sa 15:05
im looking for a solution to calculate with times… but it would be much more nice to have a function in the rules like “before” (sunrise plugin has?) so that it will be possible to make a rule like this:
if it is $timeframe before $alarmtime then do xyz
on another (not pimatic related) project, i did this in php by:
- converting time to unix timestamp
- calculating new time
- converting back to regular format
maybe this helps in here?