Verk.Time (Verk v1.7.2) View Source

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)

View Source

Specs

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)

View Source

Specs

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)

View Source

Specs

Moves DateTime supplied the indicated amount of time.

Supported units are those specified by System.time_unit