Mktime () [function. mktime]: Itisnotsafetorelyonthesystemstimezonesettings

Source: Internet
Author: User
: This article describes how to solve the problem of mktime () [function. mktime]: itisnotsafetorelyonthesystemstimezoneset.pdf. if you are interested in PHP tutorials, refer to it. Problems encountered during php code deployment:

Strict Standards: date_default_timezone_get () [function. date-default-timezone-get]: It is not safe to rely on the system's timezone settings. please use the date. timezone setting, the TZ environment variable 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 C: \ AppServ \ www \ nipin \ configs \ config. php on line 25
Strict Standards: mktime () [function. mktime]: It is not safe to rely on the system's timezone settings. please use the date. timezone setting, the TZ environment variable 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 C: \ AppServ \ www \ nipin \ configs \ config. php on line 25
Strict Standards: mktime () [function. mktime]: You shocould be using the time () function instead in C: \ AppServ \ www \ nipin \ configs \ config. php on line 25

The reason is that the difference between the GMT time obtained by php and the Beijing time is 8 hours. The Beijing time should be used.

The above error was reported mainly in one sentence:

$ Getime = date_default_timezone_get () = 'utc '? Mktime () + 28800: mktime ();

There are two solutions:

1. directly add this sentence to replace the above sentence, date_default_timezone_set ("PRC"); directly set it to the background time.

2. in the php. ini file, set:; date. timezone = Asia/Shanghai or date. timezone = PRC.

The mktime () [function. mktime]: It is not safe to rely on the systems timezone settings to solve the problem, including some content, hope to be helpful to friends interested in PHP tutorials.

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.