“Php obtenga fecha con la zona horaria” Código de respuesta

PHP Azona temporal predeterminada

date_default_timezone_set("Asia/Kolkata");
// List of Supported Timezones https://www.php.net/manual/en/timezones.php
MeVyom

Php obtenga fecha con la zona horaria

<?php
$date = new DateTime("now", new DateTimeZone('America/New_York') );
echo $date->format('Y-m-d H:i:s');
Arrogant Ape

PHP Obtenga la zona horaria

echo date_default_timezone_get(); //UTC

//Read more at https://www.php.net/manual/en/function.date-default-timezone-get.php
MeVyom

PHP DateTime Set TimeZone

$date = new \DateTime();
$date->setTimezone(new \DateTimeZone('+0800')); //GMT
echo $date->format('Y-m-d H:i:s');
// 2020-11-20 15:23:49
Aggressive Ant

Respuestas similares a “Php obtenga fecha con la zona horaria”

Preguntas similares a “Php obtenga fecha con la zona horaria”

Más respuestas relacionadas con “Php obtenga fecha con la zona horaria” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código