PHPdate function Error

Source: Internet
Author: User
Welcome to the Linux community forum and interact with 2 million technical staff to use the date function. The system time can be obtained successfully. However, the following error occurs in error_log: PHPStrictStandards: date () [ahreffunction. datefunction. datea]: Itisnotsafetorelyonthesystemstimezonesett

Welcome to the Linux community forum and interact with 2 million technicians> go to the date function to get the system time. However, the following error occurs in error_log: PHP Strict Standards: date () [ahref = 'function. date 'function. date/a]: It is not safe to rely on the system's timezone sett

Welcome to the Linux community forum and interact with 2 million technicians>

Using the date function, the system time can be obtained successfully, but the following error occurs in error_log:

PHP Strict Standards: date ()

[Function. date]: 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 'utc/0.0/no DST 'instead in/home/6wchxfpo4rhtquknkascto6m/wwwroot/share. php on line 10

This is because the date function cannot obtain the time zone information.

Solution:

Defines the time zone used before date, for example:

Date_default_timezone_set ('utc ');

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.