Jump to content

Dates functions


sergramalli

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/279715-dates-functions/
Share on other sites

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)

Link to comment
https://forums.phpfreaks.com/topic/279715-dates-functions/#findComment-1438660
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.