Jump to content

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

Edited by sergramalli
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.