Date (): Itisnotsafetorelyonthesystem 'stimezoneset.pdf

Source: Internet
Author: User
Date (): Itisnotsafetorelyonthesystem 'stimezoneset1_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 the timezone 'utc' for now, but please set date. timezone to select your timezone.

In PHP 5.3 +, you must configure timezone in the php. ini file, or use the date_default_timezone_set () method to set timezone before calling the date () function.

Case A: configure timezone in the php. ini file

#grep -B 1 timezone ./php.ini[Date]; Definesthedefault timezoneusedbythedatefunctions; http://php.net/date.timezonedate.timezone = "Asia/Shanghai"

Then restart your web/php service.

Case B:

Set timezone through date_default_timezone_set () before calling the date () function

Eg:

/* set data timezone */date_default_timezone_set("PRC");$years = date('Y');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.