Re: Formatting a Time field
| From: | Richard Lynch | Date: | Fri, 24 Mar 2006 02:51:42 +0000 |
| Subject: | Re: Formatting a Time field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232510@lists.php.net to get a copy of this message | ||
On Thu, March 23, 2006 5:51 pm, Todd Cary wrote:
> I have a field, Start_Time, in a MySQL DB. Since it is not a
> TimeStamp, I believe I cannot use date(), correct?
>
> I would like to format 09:00:00 to 9:00 AM.
>
> If I convert the 09:00:00 with the strtotime(), I get a couple of
> extra minutes added.
You may be able to convince MySQL to convert it with a function from
http://mysql.com (hint: search for convert) and that might give much
more satisfactory results.
You should also consider biting the bullet and converting the field to
a real 'Time' type.
--
Like Music?
http://l-i-e.com/artists.htm