ago_times v0.1.1 DateRange
A helper library to easily create relative times, like 2 days ago.
The result of functions is always a %DateTime{}
.
Summary
Functions
Create a past time, yielding a %DateTime{}
Types
Functions
ago(num, unit)
ago(num :: integer, unit :: time_unit) :: %DateTime{calendar: term, day: term, hour: term, microsecond: term, minute: term, month: term, second: term, std_offset: term, time_zone: term, utc_offset: term, year: term, zone_abbr: term}
Create a past time, yielding a %DateTime{}
.
Example:
# Create a DateTime, indicating 2 days ago
DateRange.ago 2, :days
Available units are :seconds
, :minutes
, :hours
, :days
and :weeks
.