Hi,
Using jquery datepicker,I have the format of the date returned from Datepicker as (yy-mm-dd) which returns the string as 2011-04-22.
When I want to INSERT it in the MySQL table in the column with datatype as DATE, I get 0000-00-00 saved. Browsing through SO, I found suggestions about FROM_UNIXTIME, but this gives me the date as 1970-01-01.
Any help ?
Date formats in MySQL are a pain, but you just have to read the documentation. Start with php.net search for function date.
On the other hand, one simple answer is to avoid the MySQL date stuff (apart from anything else, it is interpreted as local time on the server, which for me is in a funny foreign country, which doesn't even have a simple fixed conversion to GMT). Here's a sample table which I found when I checked how I do it:
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)