I want to save to database a given date with this format:
date('Y-m-d H:i:s')
Using datetime datatype, it outputs:
2012-10-29 00:18:14
To check if it gives the correct output, I add to my table a timestamp which returns the current date and time of the insertion/update, it returns:
2012-10-29 07:18:14
I suspect that there is something wrong with my format.
sounds like a timezone issue.
you can use
date_default_timezoneor thedate.timezoneini setting to have PHP use the same timezone as MySQL.you can see the MySQL timezone with: