Date_default_timezone_set () sets the time zone,
Date_default_timezone_set () sets the time zone
<? Php
Echo function_exists (date_default_timezone_set). "<br>"; // here, he always returns 1. This function is used to determine whether the character here is a defined function name.
Echo date ('Y-m-d H: I: s'). "<br>"; // Default Time Zone
Echo date_default_timezone_set ("Etc/GMT"). "<br>"; // This is the Greenwich Mean Time. The obtained time is the same as the default time zone.
Echo date ('Y-m-d H: I: s'). "<br> ";
Echo date_default_timezone_set ("Etc/GMT + 8"). "<br>"; // This is 8 hours slower than the standard time of linwei governance
Echo date ('Y-m-d H: I: s'). "<br> ";
Echo date_default_timezone_set ("Etc/GMT-8"). "<br>"; // The Last One cannot be imagined, we get 8 hours faster than that, so we get 8 fewer
Echo date ('Y-m-d H: I: s'). "<br> ";
Echo date_default_timezone_set ('prc'). "<br>"; // set the China Time Zone
Echo date ('Y-m-d H: I: s'). "<br>"; // Chinese Standard Time
?>
// Output
1
02:20:42 // Default Time Zone
1
02:20:42 // ("Etc/GMT") Greenwich Mean Time
1
18:20:42 // ("Etc/GMT + 8") 8 hours slower than the standard time of linwei governance
1
10:20:42 // ("Etc/GMT-8") 8 hours faster than the standard time of Lin Weizhi, is our Beijing Time
1
10:20:42 // ('prc') China Standard Time
Below