There are 7 other arithmetic functions that take a single argument, and these do arithmetic from "now." For example, add_years(4) is a shortcut for add_years(4, os:timestamp()).
add_seconds(Seconds)
add_minutes(Minutes)
add_hours(Hours)
add_days(Days)
add_weeks(Weeks)
add_months(Months)
add_years(Years)
Date and Time Ranges
qdate provides a number of range functions that give applicable dates/times within a start and end time. For example, "All days from 2015-01-01 to today", "every 3rd month from 2000-01-01 to 2009-12-31", or "every 15 minutes from midnight to 11:59pm on 2015-04-15".
The functions are as follows:
range_seconds(Interval, Start, End)
range_minutes(Interval, Start, End)
range_hours(Interval, Start, End)
range_days(Interval, Start, End)
range_weeks(Interval, Start, End)
range_months(Interval, Start, End)
range_years(Interval, Start, End)
Where Interval is the number of seconds/days/years/etc.
So for example:
%% Get every 15th minute from "2015-04-15 12:00am to 2015-04-15 11:59am"