Set default timezone in php

Set default timezone in php : date_default_timezone_set() sets the default timezone for all the date functions which
are used in the script.

A simple example to set default timezone in php is as :


date_default_timezone_set('America/Los_Angeles');
$date = date('Y-m-d H:i:s');

Which will return the current date as per the defalt timezone set.


Advertisements

Add Comment

📖 Read More