Tarearbol.Crontab.next
You're seeing just the function
next
, go back to Tarearbol.Crontab module for more information.
Specs
next(dt :: nil | DateTime.t(), input :: binary(), opts :: keyword()) :: DateTime.t()
Returns the next DateTime
the respective cron
record points to
with a precision given as the third argument (default: :second
.)
If the first parameter is not given, it assumes the next after now.
Examples
iex> dt = DateTime.from_unix!(1567091960)
~U[2019-08-29 15:19:20Z]
iex> Tarearbol.Crontab.next(dt, "42 3 28 08 *")
[
origin: ~U[2019-08-29 15:19:20Z],
next: ~U[2020-08-28 03:42:00Z],
second: 31494160
]
where origin
contains the timestamp to lookup the next
for, next
is the DateTime
instance of the next event and second
is the
{precision
, difference_in_that_precision
}.