Experimental project
This is a sandbox project, which contains experimental code for developer use only.
Rules Date Difference is a simple action for Rules that accepts two datetime values and calculates the time difference in years. This was created for a project where dates were incompatible with timestamp, that is all dates before 01.01.1970.
The granularity can be easily changed if you want to use days, weeks, months, et.c. Just edit the code in rules_date_difference.rules.inc , line 34, and swap out 'years' for something else.
$duration = $start_date->difference($end_date, 'years');
More about the date::difference function in the Date API.
Project information
- Project categories: Automation
- Created by busla on , updated