I want to have an easy method to calculate number of days, hours, etc. relative to a given date.

  • If now()-$changedate > 60 days …
  • If $changedate is older than 3 years …
  • $serviceDate = now() + 180 days

(For an easy to use powerfull home automation system this should be a kernel function. Workarounds with complicated scripts are not satisfied.
See also https://forum.pimatic.org/topic/3916/date-6-months.)