Apache time stamp incorrect

后端 未结 3 1260
情深已故
情深已故 2021-01-14 01:02

I am using WAMP server running PHP. At a particular step I am trying to capture system time and add it to the database with the following query

$strSQLInsert         


        
3条回答
  •  不要未来只要你来
    2021-01-14 02:02

    Try to change the timezone in the php.ini configuration file, and then restart the apache service. You should have php.ini somewhere inside your WAMP installation folder.

    EDIT: You might have the php.ini file inside the folder:

    /wamp/bin/php/phpX.X.X
    

    where phpX.X.X is your php version.

    Look for the "date.timezone" line and change it to something like this:

    date.timezone = "America/Los_Angeles"
    

    You can find the supported timezones here: http://www.php.net/manual/en/timezones.php

    More technical information is available here: http://php.net/manual/en/datetime.configuration.php

    The .htaccess file has a local range, normally to the folder and sub-folders where the file is created. Changing the php.ini file makes the changes global to your PHP installation.

提交回复
热议问题