Re: how should MS Access DATETIME be handled in PHP?

From: Date: Thu, 13 Apr 2006 22:24:35 +0000
Subject: Re: how should MS Access DATETIME be handled in PHP?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-233947@lists.php.net to get a copy of this message
On Thu, April 13, 2006 9:30 am, Bing Du wrote: > $qry = odbtp_query("SELECT end_date,title,projectID FROM projects > ORDER > BY end_date DESC"); 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" -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#233947) next »