Verk v0.13.4 Verk.Time

Internal API for time management and comparison functions

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

Functions

after?(datetime1, datetime2)

Specs

after?(DateTime.t, DateTime.t) :: boolean

returns true if the first argument occurred after the second argument

diff(datetime1, datetime2, units \\ :seconds)

Specs

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.

shift(datetime, amount, units \\ :seconds)

Specs

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