Skip to content

Commit 190635d

Browse files
committed
Add a note about the support and the behavior of the "datetimetz" type
1 parent 3db3f61 commit 190635d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

docs/en/reference/known-vendor-issues.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ MySQL
7070
DateTimeTz
7171
~~~~~~~~~~
7272

73-
MySQL does not support saving timezones or offsets. The DateTimeTz
74-
type therefore behaves like the DateTime type.
73+
Previous to version 8.0.19, MySQL does not support saving timezones or offsets. The DateTimeTz
74+
type therefore behaves like the DateTime type on previous versions.
7575

7676
Sqlite
7777
------
@@ -104,8 +104,8 @@ when trying to convert database values to ``\DateTime`` objects using
104104
DateTimeTz
105105
~~~~~~~~~~
106106

107-
Sqlite does not support saving timezones or offsets. The DateTimeTz
108-
type therefore behaves like the DateTime type.
107+
Sqlite support saving timezone offsets, but this feature is not yet implemented in DBAL.
108+
The DateTimeTz type therefore behaves like the DateTime type.
109109

110110
Reverse engineering primary key order
111111
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/en/reference/types.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,15 @@ information, you should consider using this type.
301301
Values retrieved from the database are always converted to PHP's ``\DateTime`` object
302302
or ``null`` if no data is present.
303303

304+
.. note::
305+
306+
This type is not supported by all the vendor platforms or by all of their versions. Depending on
307+
these variants, the databases that support this type may return the persisted date and time in a
308+
different timezone than the one used during the ``INSERT`` or the ``UPDATE`` operation. This means
309+
that if you persist a value like `1986-22-03 19:45:30-03:00`, you could have `1986-22-03 22:45:30-00:00`
310+
as the result of a ``SELECT`` operation for that record. In these cases, the timezone offset present
311+
in the result is usually UTC or the one configured as default in the database server.
312+
304313
datetimetz_immutable
305314
^^^^^^^^^^^^^^^^^^^^
306315

0 commit comments

Comments
 (0)