Solución:
Puedes pasar strtotime
condiciones de cadena para $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')
consulte http://php.net/manual/en/function.strtotime.php para obtener una lista completa de usos y combinaciones de cadenas.
Intente pasar una marca de tiempo de Unix para $max
:
$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);
O pasar un strtotime
cadena de tiempo para $faker->dateTimeBetween()
:
// between now and +30y
$faker->dateTimeBetween('now', '+30 years');
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)