sergramalli Posted June 30, 2013 Share Posted June 30, 2013 (edited) can just say i am all mixed up about dates and mysql. in a database should i store in an 7/12/13 format or with as a Unix Timestamp (epoch i think). so what is the best way to store dates into a database and convert back to human readable or should i make it human readable in the database If also someone could point me the right direction of a tutorial or book or something that would be good too Edited June 30, 2013 by sergramalli Quote Link to comment https://forums.phpfreaks.com/topic/279715-dates-functions/ Share on other sites More sharing options...
Barand Posted June 30, 2013 Share Posted June 30, 2013 Store them as DATE, DATETIME or TIMESTAMP types. Formats are YYYY-MM-DD HH:ii:ss for datetime and timestamp and YYYY-MM-DD for date type Using these types will give maximum functionality (usable by the date/time functions in MySql and can be easily sorted/compared) Quote Link to comment https://forums.phpfreaks.com/topic/279715-dates-functions/#findComment-1438660 Share on other sites More sharing options...
sergramalli Posted June 30, 2013 Author Share Posted June 30, 2013 oh ok, seems like your saying either way...right?Thank you for answering my question Quote Link to comment https://forums.phpfreaks.com/topic/279715-dates-functions/#findComment-1438689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.