How do I get future dates with:
https://github.com/fzaninotto/Faker#fakerproviderdatetime
dateTime($max = 'now')
i.e. what should the $max value be for datetime in the future
How do I get future dates with:
https://github.com/fzaninotto/Faker#fakerproviderdatetime
dateTime($max = 'now')
i.e. what should the $max value be for datetime in the future
You can pass strtotime
string conditions to $faker->dateTimeBetween()
.
//ranging from today ending in 2 years
$faker->dateTimeBetween('+0 days', '+2 years')
//ranging from next week ending in 1 month
$faker->dateTimeBetween('+1 week', '+1 month')
//ranging from next sunday to next wednesday (if today is wednesday)
$faker->dateTimeBetween('next sunday', 'next wednesday')
see http://php.net/manual/en/function.strtotime.php for a full list of string usages and combinations.
Try passing a unix timestamp for
$max
:Or pass a
strtotime
timestring to$faker->dateTimeBetween()
: