The phpdate () time function reports an error. the time zone issue is UTCPRCCST. In php, if we do not configure the time zone and run the php date and time function, some time zone errors will be prompted, or the time zone may be incorrect, if we do not configure the time zone in php and run the php date and time function for a few hours related to Beijing time, some time zone errors will be prompted, or the time zone may be incorrect, I am going to discuss several hours related to Beijing time.
When PHP versions later than PHP5.3 are used, if it is time-related,
I am using
Echo date ('Y-m-D ');
?>
Prompt
"PHP Warning: date () [function. date]: It is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we selected 'utc' for '8. 0/no DST 'Instead in"
In fact, when using functions such as date () in PHP 5.1.0, if the timezone settings are incorrect, the E_NOTICE or E_WARNING information will be generated each time the time function is called. In php5.1.0, date. the timezone option is disabled by default. no matter what php command is used, the Greenwich Mean Time is used. However, it seems that this error will be forcibly thrown out in PHP5.3 if it is not set, to solve this problem, just localize it.
There are three methods (either of them ):
1. use date_default_timezone_set () in the page header to set date_default_timezone_set ('prc'); // echo date ('Y-m-d H: I: s') in the East eight time zone ');
2. use ini_set ('date. timezone ', 'Asia/Shanghai') in the page header ');
3. modify php. ini. Open php5.ini to search for date. timezone. remove the semicolon and change it to: date. timezone = PRC.
...