time retrieved incorrectly from mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jasonblack
Forum Newbie
Posts: 1
Joined: Mon Oct 27, 2008 5:00 pm

time retrieved incorrectly from mysql

Post by jasonblack »

First let me vent a second by saying that this has been maddening. Also, it has nothing to do with timezone configuration. You'll start to think that it does but I promise you, it doesn't.

Dates stored in mysql (with type date) are stored correctly. When retried via php date() , however, they are one day behind (ie., looking at raw mysql record is 10-27-2008 but as retrieved by php, it's 10-26-2008).

Dates stored in mysql (with type datetime) are stored and retrieved correctly.

This behavior is 100% consistent (at all times of day). Any ideas?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: time retrieved incorrectly from mysql

Post by VladSun »

Please, post you PHP and SQL code, so we would be able (or not) to reproduce your problem.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply