What should the CSV date look like
to bring it correctly into its corresponding
Mysql field, which is formatted as a 10-digit integer field?
Thank you.
What should the CSV date look like
to bring it correctly into its corresponding
Mysql field, which is formatted as a 10-digit integer field?
Thank you.
if your mysql field is an int(10), then don't even bother...
Drop your field, and recreate it as timestamp.
Then, you can fetch it with nearly any syntax to the db, and it shoul be able to cope with it.
Don't trust what a select shows you, a date field is totally different of an int field, and is specially designed to make life easier when dealing with dates.
Use it...
http://dev.mysql.com/doc/refman/5.0/...functions.html
Code:mysql> select timestamp('20071215235026'); +-----------------------------+ | timestamp('20071215235026') | +-----------------------------+ | 2007-12-15 23:50:26 | +-----------------------------+ 1 row in set (0.00 sec)
tripy - Having once read a superb book (by the Sitepoint people)
about dates (using PHP, Mysql and javascript), I already have a whole lot
of code resting on this 10-digit integer Mysql format.
It really proved (for me) to be the best formatting policy
with regard the aforementioned languages.
Bookmarks