The time and date of the php program call time do not match the time at that time. Solution

Source: Internet
Author: User
The time and date of the php program call time do not match the time at that time. solution: the time and date of the php program call time do not match the time at that time. the system environment is win2003 + php5.2 + mysql5.0 today we found that echodate (y-m-dh: i: s, time () date and local time do not match, so find the appropriate solution: modify php. ini open p php program call time occurrence time and date does not match the time at that time DE solution

The time and date of the php program call time do not match the time at that time


The system environment is win2003 + php5.2 + mysql5.0

Today, we found that echo date ("y-m-d h: I: s", time () does not match the local time, so the proper solution is:

Modify php. ini open php. search for date in ini. remove the semicolon = Asia/Shanghai from timezone and restart the IIS service (if this problem is not found on the linux server, restart the apache service on the linux server ).
After modification, as shown below:
Date. timezone = "Asia/Shanghai)

For the values after date. timezone,
Available values in mainland China: Asia/Chongqing (Chongqing), Asia/Shanghai (Shanghai), Asia/Urumqi (Urumqi )? Available in Hong Kong and Taiwan: Asia/Macao (Macao), Asia/Hong_Kong (Hong Kong), Asia/Taipei (Taipei)
? Singapore: Asia/Singapore
? Other available values: Etc/GMT-8, Singapore, Hongkong, PRC (People's Republic of China)
You can also search for the time zone identifier to write data. if you are interested, try again.

If there are good ways to share and learn from everyone

You can write a test page to test it.

You can write a test page.

$ Today = date ("F j, Y, g: I ");
Echo $ today;
?>

You can also use phpinfo to view the php date.
Phpinfo ();
?>

Find date in it to view it.

?

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.