Re: Formatting a Time field
| From: | Tom Rogers | Date: | Fri, 24 Mar 2006 01:18:58 +0000 |
| Subject: | Re: Formatting a Time field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232492@lists.php.net to get a copy of this message | ||
Hi,
Friday, March 24, 2006, 9:51:48 AM, you wrote:
TC> I have a field, Start_Time, in a MySQL DB. Since it is not a
TC> TimeStamp, I believe I cannot use date(), correct?
TC> I would like to format 09:00:00 to 9:00 AM.
TC> If I convert the 09:00:00 with the strtotime(), I get a couple of
TC> extra minutes added.
TC> Suggestions are welcomed....
TC> Todd
use gmdate() to do the formatting. in strtotime you should give a date something
like
$ftime = gmdate('h:i A',strtotime("2000-01-01 $Start_Time"));
--
regards,
Tom