我如何获得 future 的约会:
https://github.com/fzaninotto/Faker#fakerproviderdatetime
dateTime($max = 'now')
即将来的日期时间的$ max值应该是多少
最佳答案
尝试传递$max
的unix时间戳:
$unixTimestamp = '1461067200'; // = 2016-04-19T12:00:00+00:00 in ISO 8601
echo $faker->dateTime($unixTimestamp);
echo $faker->date('Y-m-d', $unixTimestamp);
// for all rows
$faker->dateTimeBetween('now', $unixTimestamp);
或者将
strtotime
时间字符串传递给$faker->dateTimeBetween()
:// between now and +30y
$faker->dateTimeBetween('now', '+30 years');
关于php - 如何在Faker中获得 future 的约会,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31076792/