duanjurong1347 2012-08-24 05:52
浏览 14
已采纳

PHP时间()不诚实

im using this function

time() in php im doing

echo date("c",time());

however its not returning me the honest time , as i can see my system time is 12:20 but the output is

2012-08-24T08:48:42+02:00

what seems to be the problem , i tried doing :

echo date("r",time());

but same results were observed

Just for people who might reffer the question latter : you dont need to set any time zones , you just need to change the php.ini file on your localhost you have a field "date.timezone" you must set it to the same time zone as your OS thats it

  • 写回答

1条回答 默认 最新

  • doushajian2018 2012-08-24 05:53
    关注

    You may have to set the timezone first. I guess that would be the problem. Check date_default_timezone_set. To check your current timezone, use date_default_timezone_get. As of PHP5.4, if you don't set anything, PHP defaults to use UTC. (Check the manual pages).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度