$t1 = (new DateTimeImmutable('1900-01-01T00:00:00'))->getTimestamp();
$t2 = (new DateTimeImmutable('1950-01-01T00:00:00'))->getTimestamp();
$t = rand($t1, $t2);
print (new DateTimeImmutable())->setTimestamp($t)->format(DateTimeInterface::RFC3339);
// 1915-10-14T19:08:14+00:00
$start = new DateTimeImmutable('1878-10-11');
$finish = new DateTimeImmutable('2009-10-13');
$interval = $start->diff($finish);
$daysDiff = $interval->format('%a');
$randomDays = rand(0, $daysDiff);
$randomDate = $start->add(new DateInterval("P${randomDays}D"));
echo $randomDate->format('Y-m-d'); // 1896-06-24