Posted by Tony Marston on 09/10/06 22:33
The best way to store a date is as a DATE datatype in YYYY-MM-DD format so
you can do comparisons between different dates. How you display them to the
user is another problem. I prefer not to format any dates until as late as
possible, just before I present them to the user.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
"turnitup" <same@same> wrote in message
news:45027de4$0$1377$da0feed9@news.zen.co.uk...
>I have found that by far the easiest way to store dates in my LAMP
>application is in a text string in the database in Unixtime format.
>
> First of all, what would be the most efficient data type to store this as?
>
> Secondly, in terms of translating into a human readable format, is it
> quicker to format the date in the application using date() or in the
> database in the select query?
>
> Any thoughts?
[Back to original message]
|