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.

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

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.