The initialization statement for adding time to the program: "Date_default_timezone_set (" Asia/shanghai ");
Definition and usage
The Date_default_timezone_set () function sets the default timezone used by all date/time functions.
The function of the Date_default_timezone_set () is to set the default time zone for all datetime functions in a script.
Syntax
Grammar
Date_default_timezone_set (TimeZone) |
Parameter Parameter |
description Describe |
TimeZone |
Required. The timezone identifier, like "UTC" or "Europe/paris". List of valid timezones:http://www.php tutorials. net/manual/en/timezones.php Necessary parameters, time zone confirmations, such as "UTC" or "Europe/paris". The valid time zones are listed below: http://www.php.net/manual/en/timezones.php |
Tips Tutorials and Notes
Watch out.
Note: This function is always returns True (even if the timezone parameter isn ' t valid).
Note: This function always returns True (even if the time zone parameter is invalid).
Example
Case
The output of the code above would be:
The code above will output the following result:
http://www.bkjia.com/PHPjc/632328.html www.bkjia.com true http://www.bkjia.com/PHPjc/632328.html techarticle The initialization statement that adds time to the program: Date_default_timezone_set (Asia/shanghai); Define and use the Date_default_timezone_set () function sets the Default timezone used by all d ...