<?php
$a = strtotime('1980-01-01 00:00');
$b = strtotime('1990-01-01 00:00');
$c = rand($a,$b);
$d = date('Y-m-d H:m', $c);
echo 'Метка времени:'. $c . '<br>';
$date = new DateTime($d, new DateTimeZone("Europe/Moscow"));
$date1 = new DateTime($d, new DateTimeZone("Europe/Amsterdam"));
$date2 = new DateTime($d, new DateTimeZone("America/New_York"));
echo $date . '<br>';
echo $date1 . '<br>';
echo $date2;
?>
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1988-09-11 11:09<br>) at position 16 (<): Unexpected character' in C:\OpenServer\domains\localhost\index71.php:23 Stack trace: #0 C:\OpenServer\domains\localhost\index71.php(23): DateTime->__construct('1988-09-11 11:0...', Object(DateTimeZone)) #1 {main} thrown in C:\OpenServer\domains\localhost\index71.php on line 23