Working with "time" data from MYSQL
| From: | Sebastian Hofferberth | Date: | Wed, 04 Jun 2008 22:40:19 +0000 |
| Subject: | Working with "time" data from MYSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-45042@lists.php.net to get a copy of this message | ||
Hi
I have a MYSQL/PHP question for which I do not find an answer on the web.
I have a MySQL table with a column of datatype "time". What I want to do is
read the values from this table but display the database entries plus 6
hours. For example, when the database entry is 12:00:00, I want to display
18:00:00 on my website.
I tried all kinds of tricks, with strtotime() in PHP and UNIX_TIMESTAMP() in
MySQL, but I simply cannot figure it out.
When I start with normal strings instead of times, it works fine in PHP, but
I do not manage to convert the MySQL time data into strings.
Thanks for any advise!
Sebastian