Re: how should MS Access DATETIME be handled in PHP?
| From: | Bing Du | Date: | Fri, 14 Apr 2006 13:29:22 +0000 |
| Subject: | Re: how should MS Access DATETIME be handled in PHP? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233986@lists.php.net to get a copy of this message | ||
> While all the data-munging in PHP is very interesting...
>
> Might I suggest that you just use MySQL's date_format() function to
> ask MySQL to give you the data you want in the first place?
>
> Some purists would claim that the database is not the place to put
> presentation logic, of course.
>
> And for a large-scale library where other users might want to skin a
> different format, I couldn't agree more.
>
> But, really, for a small project, K.I.S.S. wins out, and having MySQL
> just hand you what you want instead of cluttering up your code with
> several lines (or a long multi-operation line) of PHP, seems like a
> cleaner solution.
>
> Not to mention that you'll have a lot less headaches like this one.
>
> http://mysql.com and search for "date_format"
Thanks, Richard. I agree with you. Is date_format() a MySQL specific
funtion? If so, we're out of luck because our backend DB is MS Access.
Bing