dtvnnhh8992 2014-01-26 03:49
浏览 42

我无法在php中得到合适的时间

I am new to PHP and I am having a timing problem in my code. Right now the time on my computer and in my time zone is 10:43 but when I use this php code to display time info I get 1:43:27

date_default_timezone_set('America/New_York');
echo date('H:i:s');

in my php.ini file I have this

I just changed where it says date.timezone

; Defines the default timezone used by the date functions
date.timezone = America/New_York
; http://php.net/date.timezone
date.timezone = UTC

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333

I thought the above code would fix this time problem. I also stopped and started WAMP before and after I changed the .ini file.

Thank You.

  • 写回答

1条回答 默认 最新

  • donglian2106 2014-01-26 04:20
    关注

    I use ini_set("date.timezone","America/New_York")

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)