PHP 4 Dates Wrong

36 views Asked by At

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

There are 0 answers