Jump to content

How do I change the appearance of time/date?


jdlev

Recommended Posts

You can save your dates like that (11/12/12) but it will be as much use as a chocolate teapot. You cannot do sorts or comparisons on dates in that format, nor can you use the dozens of extremely useful dattime functions without converting it first.

 

Store dates for functionality, not for their appearance.

Edited by Barand
Link to comment
Share on other sites

Store them as Y-m-d H:i:s or as a Unix Timestamp.

 

I disagree with using unix timestamps - you still have to convert those to use datetime functions. USE DATE, DATETIME or TIMESTAMP types (whereTIMESTAMP is the MySQL type)

 

edit:

Not only that, if you are browsing the data in your table unix time values are impossible to interpret

Edited by Barand
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.