Let's assume a 64 bit version of PHP in case that matters
I'm thinking about generating a random datetime but I realised I don't know how far back in time or how far forward in time the min-max possible values for datetime are to use as min-max for random
<?php
$min = \date_create('@' . PHP_INT_MIN);
var_dump($min->format('Y-m-d H:i:s'));
$max = \date_create('@' . PHP_INT_MAX);
var_dump($max->format('Y-m-d H:i:s'));
$diff = \date_diff($min, $max);
echo $diff->format("%R%a days");
This is the earliest and furthest datetime I've found so far
Not sure why I'm getting 0 days in the diff though