Jump to content

Best method of storing date and time into databse.


HCProfessionals

Recommended Posts

Read this article first.  http://www.gizmola.com/blog/archives/93-Too-much-information-about-the-MySQL-TIMESTAMP.html

 

We really need more information to best answer this question.  In particular, what is the range of these date/time values.  What will you be doing with them?  Are they arbitrary date/time's that the user enters in some fashion through the UI, or automatically set (timestamped) by the system.

Link to comment
Share on other sites

I typically use DATETIME when I just need to log a date or do some minor calculations.

 

Anything complex, I like to leave the calculations out of the SQL statement and let PHP handle it so I'll use timestamp.  But that has been rare for me.

Link to comment
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.