Apache的时间戳不正确 [英] Apache time stamp incorrect
问题描述
我使用WAMP的服务器上运行PHP。在某些特定步骤,我想捕捉系统时间,并与下面的查询添加到数据库
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 = "UPDATE track SET State = 'Repeat' , DateTime = '" . date("m/d/Y h:i:s a") . "', where AccID like '". $values['SampleID'] ;
但时间戳的方式又比我的系统时间。日期是好的。我一派,发现我可以更新我的.htaccess这一行
but the time stamp is way off than my system time. The date is okay. I googled and found out that I can update my .htaccess with this line
SetEnv TZ America/Los_Angles
但我找不到在哪里htaccess是。我如何得到正确的时间戳。
But I couldn't find where htaccess is. How do I get the correct time stamp.
推荐答案
尝试改变的php.ini
配置文件中的时区,然后重新启动Apache服务。
你应该有的php.ini
在你的WAMP的安装文件夹的地方。
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.
编辑:您可能具有文件夹中的php.ini文件:
You might have the php.ini file inside the folder:
/wamp/bin/php/phpX.X.X
在这里phpX.X.X是你的PHP版本。
where phpX.X.X is your php version.
查找date.timezone行并将其更改为是这样的:
Look for the "date.timezone" line and change it to something like this:
date.timezone = "America/Los_Angeles"
您可以在这里找到支持时区: http://www.php.net/manual/en/timezones.php
You can find the supported timezones here: http://www.php.net/manual/en/timezones.php
更多技术信息,请访问: http://php.net/manual/en /datetime.configuration.php
More technical information is available here: http://php.net/manual/en/datetime.configuration.php
.htaccess文件具有局部范围内,正常的文件夹,并在其中创建文件的子文件夹。修改php.ini文件,使全球变化到你的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.
这篇关于Apache的时间戳不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!