Specify the default timezone.
| <?php date_default_timezone_set(“Asia/Bangkok”); echo date_default_timezone_get(); ?> |
The date_default_timezone_set() function sets the default timezone for all date/time functions in the script.
| date_default_timezone_set(timezone) |
|
Parameter |
Description |
|
timezone |
Required. Specifies the timezone to use, like “UTC” or “Europe/Paris”. List of valid timezones: http://www.php.net/manual/en/timezones.php |
|
Return Value: |
Returns FALSE if the timezone is invalid; TRUE otherwise. |
|
PHP Version: |
5.1+ |
|
PHP Changelog: |
Returns FALSE if the timezone is invalid; TRUE otherwise. |