Hey I am having trouble with dates currently. I have a simple table like this.
CREATE TABLE IF NOT EXISTS `pages` (
`page_id` int(11) NOT NULL AUTO_INCREMENT,
`day_of_birth` date NOT NULL,
PRIMARY KEY (`page_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
I insert string to the database (YYYY-MM-DD)
'1980-06-05'
and I echo the date like this:
echo date('d.m.Y',strtotime($page_info['day_of_birth']));
My problem is every day date record goes 1 day earlier. For instance, I save this date '1980-06-05'. next day I will see '1980-06-04' in my database and the day after that it will be '1980-06-03'. I think the type of the column cause that. What do you think? How can I fix this problem? is my echoing code correct?