PHP中是否有任何方法或函数可以从互联网上获取特定时区的当前DateTime。不是本地系统的时间。请引导我。
$now = new DateTime();
$now->setTimezone(new DateTimezone('Europe/Paris'));
echo $now->format('Y-m-d H:i:s');
将'Europe/Paris'
替换为您想要的任何时区
PHP中是否有任何方法或函数可以从互联网上获取特定时区的当前DateTime。不是本地系统的时间。请引导我。
$now = new DateTime();
$now->setTimezone(new DateTimezone('Europe/Paris'));
echo $now->format('Y-m-d H:i:s');
将'Europe/Paris'
替换为您想要的任何时区