Re: Re: date & time conversion confusion

From: Date: Mon, 06 Nov 2000 21:05:33 +0000
Subject: Re: Re: date & time conversion confusion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23979@lists.php.net to get a copy of this message
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_and > _time_function > > Note that is a single line! -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/

« previous php.general (#23979) next »