Faker Elixir (octopus) v1.0.2 FakerElixir.Date

Generate fake data for the domain Date

Summary

Functions

Return a date in the future

Return birthday date

Return a date in the future

Functions

backward(range)

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"
birthday()

Return birthday date

Examples

iex > FakerElixir.Date.birthday
"1988-03-07 16:28:37Z"
forward(range)

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"