Re: Time formatting issues

From: Date: Mon, 16 Jul 2007 16:49:40 +0000
Subject: Re: Time formatting issues
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-258944@lists.php.net to get a copy of this message
Melissa W. Dickens wrote:
Thank you VERY much Jay, Chris and Gary! I tried the php code to change it and that worked Great, as Chris suggested I am about to see how it flies with changing the SQL DB directly as Gary suggested. I might even just ADD a new DB field for the new format... The mktime function looks VERY interesting, but confusing to a newbie... That will be next on my list of things to try. Melissa No need to create a new field just for another format. If you are using mysql 5 you can create a view.
mysql> create view view_name as select DATE_FORMAT(time_column, '%h:%i:%s %p') as time from your_table; Query OK, 0 rows affected (0.00 sec) mysql> select * from view_name; +-------------+
| time        |
+-------------+ | 12:45:41 PM | +-------------+ 1 row in set (0.00 sec) This way you're not updating multiple columns with the same data formated differently.

« previous php.general (#258944) next »