View Source F1Bot.Time (f1_bot v0.7.0)

Link to this section Summary

Functions

Equivalent to Timex.between?/3 except it treats nil from_ts and to_ts values as negative and positive infinity

Link to this section Functions

Link to this function

between?(ts, from_ts, to_ts)

View Source
@spec between?(DateTime.t(), DateTime.t() | nil, DateTime.t() | nil) :: boolean()

Equivalent to Timex.between?/3 except it treats nil from_ts and to_ts values as negative and positive infinity

examples

Examples

iex> F1Bot.Time.between?( ...> Timex.from_unix(10), ...> Timex.from_unix(5), ...> nil ...> ) true

iex> F1Bot.Time.between?( ...> Timex.from_unix(10), ...> nil, ...> Timex.from_unix(15) ...> ) true

iex> F1Bot.Time.between?( ...> Timex.from_unix(10), ...> nil, ...> nil ...> ) true

iex> F1Bot.Time.between?( ...> Timex.from_unix(10), ...> Timex.from_unix(1000), ...> Timex.from_unix(2000) ...> ) false

Link to this function

unix_timestamp_now(precision)

View Source