Faker.Date (Faker v0.16.0) View Source
Functions for generating dates
Link to this section Summary
Functions
Returns a random date in the past up to N days, today not included
Returns a random date between two dates
Returns a random date of birth for a person with an age specified by a number or range
Returns a random date in the future up to N days, today not included
Link to this section Functions
Specs
Returns a random date in the past up to N days, today not included
Specs
Returns a random date between two dates
Examples
iex> Faker.Date.between(~D[2010-12-10], ~D[2016-12-25])
~D[2013-06-07]
iex> Faker.Date.between(~D[2000-12-20], ~D[2000-12-25])
~D[2000-12-20]
iex> Faker.Date.between(~D[2000-02-02], ~D[2016-02-05])
~D[2014-10-23]
iex> Faker.Date.between(~D[2010-12-20], ~D[2010-12-25])
~D[2010-12-21]
Specs
Returns a random date of birth for a person with an age specified by a number or range
Specs
Returns a random date in the future up to N days, today not included