Faker Elixir (octopus) v1.0.2 FakerElixir.Date
Generate fake data for the domain Date
Summary
Functions
Return a date in the future
Examples
Context: 19 august 2016
# Generate a random date time for yesterday
iex > FakerElixir.Date.backward(1)
"2016-08-18 05:58:04Z"
# Generate a random date time for the day before yesterday
iex > FakerElixir.Date.backward(2)
"2016-08-17 00:15:28Z"
# Generate a random date time between yesterday and the day before yesterday
iex > FakerElixir.Date.backward(1..2)
"2016-08-17 03:48:32Z"
Return a date in the future
Examples
Context: 19 august 2016
# Generate a random date time for tomorrow
iex > FakerElixir.Date.forward(1)
"2016-08-20 19:29:28Z"
# Generate a random date time for after tomorrow
iex > FakerElixir.Date.forward(2)
"2016-08-21 19:06:12Z"
# Generate a random date time between tomorrow and after tomorrow
iex > FakerElixir.Date.forward(1..2)
"2016-08-20 11:18:18Z"