Req #81644 [Opn->Sus]: mysql native driver should use DateTime object
| From: | cmb@php.net | Date: | Mon, 22 Nov 2021 13:42:26 +0000 |
| Subject: | Req #81644 [Opn->Sus]: mysql native driver should use DateTime object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237910@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81644&edit=1
ID: 81644
Updated by: cmb@php.net
Reported by: shop1 at mokraemer dot de
Summary: mysql native driver should use DateTime object
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: MySQLi related
Operating System: Linux
PHP Version: 8.0.13
Block user comment: N
Private report: N
New Comment:
> Since RFC's are not easy to make for php, I guess this is the
> end of that idea.
Consider to *start* the RFC process[1] anyway (i.e. write to the
mailing list). Maybe others are interested in this as well, but
it's unlikely those will see this ticket.
For the time being, I'm suspending this ticket.
[1] <https://wiki.php.net/rfc/howto>
Previous Comments:
------------------------------------------------------------------------
[2021-11-20 21:10:16] shop1 at mokraemer dot de
Thanks for your comment. You're right about Date/Time we don't have anything in php for
that.
For datetime and timestamp there is no problem with timezones. The conversion is done by mysql on
the connection base. Anyway, now everyone who uses DateTime or timestamps from mysql in php needs to
do convert that column to a DateTime object in order to do anything with the value from the
database.
But maybe you're right this needs some more thinking and an RFC. Since RFC's are not easy
to make for php, I guess this is the end of that idea.
------------------------------------------------------------------------
[2021-11-20 11:47:44] heiglandreas@php.net
As PHP - at least currently - does not have native types for Date and Time there will be no
possibility to convert those into Objects.
And I don't even want to tackle the topic of converting Datetime values with regards to
timezones. As there is no "One size fits all" it is best to leave that up to the app.
And as the native mysqli driver only converts between native types I doubt that that is a thing that
we should start.
If so, we would for sure need an RFC for that.
------------------------------------------------------------------------
[2021-11-20 10:56:07] shop1 at mokraemer dot de
Description:
------------
if you use mysqli native driver, it fetches data and puts the data in the equivalent php
datastructure. This is true for float, int, ...
But values for date,time and datetime are still strings. It would be great if this is converted
automatical.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81644&edit=1