``` --- ## Definition and Usage The"> ``` --- ## Definition and Usage The" />
Easy Tutorial
❮ Func Cal Easter Date Func Filter Var ❯

PHP date_default_timezone_set() Function

PHP Date/Time Reference Manual

Example

Set the default timezone:

<?php
date_default_timezone_set("Asia/Shanghai");
echo date_default_timezone_get();
?>

Definition and Usage

The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.

Syntax

Parameter Description
timezone Required. Specifies the timezone to use, such as "UTC" or "Europe/Paris". List of valid timezones: http://www.php.net/manual/en/timezones.php

Technical Details

Return Value: Returns FALSE if the timezone is invalid, otherwise returns TRUE.
PHP Version: 5.1+
--- ---
Changelog: Since PHP 5.1.2+, this function validates the timezone parameter. Since PHP 5.3+, it throws E_WARNING instead of E_STRICT.
--- ---

❮ Func Cal Easter Date Func Filter Var ❯