Answer the question
In order to leave comments, you need to log in
How to set timezones in php?
I need to convert a random timestamp to a date and display it in 3 time zones (Moscow, Tokyo, New York), help with this issue
<?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>';
echo $d;
?>
Answer the question
In order to leave comments, you need to log in
$date = new DateTime("2010-07-05T06:00:00Z", new DateTimeZone("Europe/Amsterdam"));
php.net/manual/en/refs.calendar.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question