XAMPP PHP 日期函数时间与本地机器时间不同 [英] XAMPP PHP date function time is different from local machine time
问题描述
我的电脑当地时间是12-03-2013 4:30pm
.
我的 XAMPP 日期函数将时间打印为 12-03-2013 10:49:56
.
My XAMPP date function prints the time as 12-03-2013 10:49:56
.
如何设置 XAMPP 服务器时间以显示系统时间?
How can I set the XAMPP server time to display the system time?
推荐答案
转到 C:\xampp\php\php.ini
,或者你的自定义路径 php.ini
代码>是,打开它.
Go to C:\xampp\php\php.ini
, or your custom path where php.ini
is, open it.
查找以下内容:date.timezone = "Europe/Warsaw"
.可能你的价值与我的Europe/Warsaw
不同.所以只搜索字符串:date.timezone
.
Look for the following: date.timezone = "Europe/Warsaw"
. Probably You have different value than my Europe/Warsaw
. So search just string: date.timezone
.
将值 Europe/Warsaw
更改为正确的值,例如 date.timezone = "Asia/Kolkata"
Change value Europe/Warsaw
to the proper value, for example date.timezone = "Asia/Kolkata"
如果有人正在寻找他的位置,请检查有效值 http://php.net/manual/en/timezones.php
If someone's looking for his location, check valid values http://php.net/manual/en/timezones.php
不要忘记重新启动 XAMPP.
Don't forget to restart your XAMPP.
这篇关于XAMPP PHP 日期函数时间与本地机器时间不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!