Verk v1.7.0 Verk.Time
Internal API for time management and comparison functions
Link to this section Summary
Functions
returns true if the first argument occurred after the second argument
Returns the number of indicated units that separate the two timestamps.
Moves DateTime supplied the indicated amount of time.
Link to this section Functions
Link to this function
after?(datetime1, datetime2)
after?(datetime1, datetime2)
after?(DateTime.t(), DateTime.t()) :: boolean()
after?(DateTime.t(), DateTime.t()) :: boolean()
returns true if the first argument occurred after the second argument
Link to this function
diff(datetime1, datetime2, units \\ :second)
diff(datetime1, datetime2, units \\ :second)
diff(DAteTime.t(), DateTime.t(), System.time_unit()) :: integer()
diff(DAteTime.t(), DateTime.t(), System.time_unit()) :: integer()
Returns the number of indicated units that separate the two timestamps.
A positive result indicates that datetime2
occurred after datetime1
.
Link to this function
shift(datetime, amount, units \\ :second)
shift(datetime, amount, units \\ :second)
shift(DateTime.t(), integer(), System.time_unit()) :: DateTime.t()
shift(DateTime.t(), integer(), System.time_unit()) :: DateTime.t()
Moves DateTime supplied the indicated amount of time.
Supported units are those specified by System.time_unit