Re: Re: date & time conversion confusion

From: Date: Mon, 06 Nov 2000 22:54:34 +0000
Subject: Re: Re: date & time conversion confusion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24001@lists.php.net to get a copy of this message
Thanks Doug, I tried that before but somehow it worked this time! Thanks again! Brian on 11/6/00 4:05 PM, Thomas Deliduka at thomas@neweve.com wrote: > Dang, I can't believe all this time i used four lines of code I didn't need > to use. > > On 11/6/00 3:39 PM this was written: > >> How about getting MySQL to give you the information in the format that you >> want? Suppose the date value you want is in the column named "thedate", do >> something like: >> >> SELECT DATE_FORMAT(thedate,"%M %d %Y) FROM tablename; >> >> This would give something like "January 10 2000" Similiarly to change from >> 24 hour clock to 12 hour clock with an AM or PM suffix: >> >> SELECT DATE_FORMAT(thetime,"%r") FROM tablename; >> >> Look at >> >> http://www.mysql.com/documentation/mysql/commented/manual.php?section=Date_a n>> d >> _time_function >> >> Note that is a single line!

« previous php.general (#24001) next »