douzhangli9563 2015-06-25 23:31
浏览 12

PHP 4日期错误

According to Yahoo, my account is using MySQL 4.1.14, and PHP 4. Yeah, I know I am a bit behind. I noticed some funny things started going on with my code a while back, around dates. But I thought time zone setting did not come into play until PHP 5.

Anyway, I am pulling dates from a database using UNIX_TIMESTAMP, and it gives me a timestamp like 1436745600 for a date 2015-07-13 stored in my database. This looks correct to me. But then my code simply does a date('M-j','variable storing that number'), and it gives me 'July-12'. Why is this?

I know I am PST, and the server is UTC, but on version 4, how would PHP know that? And even if it did, we are both on the same day for most of a 24 hour cycle. As I started writing this, we were on the same day, and still the problem occurred. As I finish, we are on different days, and the result is the same. Something else going on here?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)