Answers for "show current time in differnt timezones php"

PHP
0

php get date using timezone

<?php
$date = new DateTime("now", new DateTimeZone('America/New_York') );
echo $date->format('Y-m-d H:i:s');
Posted by: Guest on August-03-2020
2

how to get the list of available timezones in php

//To Get the list of timezones available in php
//use the static function listIdentifiers() on DateTimeZone class
$list = DateTimeZone::listIdentifiers();
print_r($list)
Posted by: Guest on April-25-2020
0

Php get all timezone

$tzlist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
Posted by: Guest on March-09-2022

Browse Popular Code Answers by Language