Php Get Timezone

[Solved] Php Get Timezone | Php - Code Explorer | yomemimo.com
Question : php get date using timezone

Answered by : arrogant-ape-94gd8klhvmtj

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

Source : https://stackoverflow.com/questions/8006692/get-current-date-given-a-timezone-in-php | Last Update : Mon, 10 Aug 20

Question : php get timezone

Answered by : aashit-vyom

echo date_default_timezone_get(); //UTC
//Read more at https://www.php.net/manual/en/function.date-default-timezone-get.php

Source : https://www.php.net/manual/en/function.date-default-timezone-get.php | Last Update : Wed, 22 Jul 20

Question : php set timezone

Answered by : asep-indra-kurniawan

date_default_timezone_set('Asia/Jakarta');

Source : | Last Update : Wed, 20 Apr 22

Question : set timezone in php

Answered by : frail-falcon-9e9q8cqpjwm6

date_default_timezone_set('Asia/Kolkata);

Source : | Last Update : Mon, 29 Nov 21

Question : php timezone

Answered by : muhammad-ishaq

date_default_timezone_set("Asia/Karachi");
//if you wand your timezone in whole website than go to config/app.php
// and serch for timezone, now pass your time zone. in my case
'timezone' => 'Asia/Karachi',
//Go to following link to find your timezone
// https://www.php.net/manual/en/timezones.asia.php

Source : https://www.php.net/manual/en/timezones.asia.php | Last Update : Sat, 04 Jun 22

Question : Php get all timezone

Answered by : md-hasanur-rahman-hasan

$tzlist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);

Source : | Last Update : Wed, 16 Mar 22

Answers related to php get timezone

Code Explorer Popular Question For Php