#9902 [Com]: Converting to/from mysql timestamp
| From: | phpbug at intobikes dot co dot uk | Date: | Mon, 10 May 2004 21:33:07 +0000 |
| Subject: | #9902 [Com]: Converting to/from mysql timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59482@lists.php.net to get a copy of this message | ||
ID: 9902
Comment by: phpbug at intobikes dot co dot uk
Reported By: mail at scottbrinker dot com
Status: Bogus
Bug Type: Feature/Change Request
Operating System: Red Hat Linux 7.x
PHP Version: 4.0.4pl1
New Comment:
Scott.. I totally agree. When doing a SELECT * FROM...... query you
aren't specifying the fields, so cannot convert the timestamp field as
suggested. It is a glaring omission from PHP that really should be
fixed.
John
Previous Comments:
------------------------------------------------------------------------
[2002-07-16 01:44:01] georg@php.net
It's make no sense to have this functionality on the
client side, if the server side supports it already.
Use the MySQL Functions DATE_FORMAT, TIME_FORMAT and
UNIX_TIMESTAMP for converting timestamp fields.
If you need some more special functions, you can also
extend MySQL with an additionally UDF.
------------------------------------------------------------------------
[2001-03-21 11:56:06] mail at scottbrinker dot com
I propose some new functions for those of us that use PHP and mySQL
together on a daily basis...
I would suggest a function that acts like getdate() which produces an
array of time and date data from a mySQL timestamp (YYYYMMDDHHMMSS).
Along these lines, functions which convert between a unix timestamp and
a mySQL timestamp would be useful.
Surely I'm not the only one that has to include my own custom functions
to produce these results.
Having standard distribution-based versions of these functions would
make my and others work a lot easier.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=9902&edit=1