WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,12 @@ normalizers (in order of priority):
`RFC 3339`_ format. Use ``DateTimeNormalizer::FORMAT_KEY`` and
``DateTimeNormalizer::TIMEZONE_KEY`` to change the format.

To always create :phpclass:`DateTime` and :phpclass:`DateTimeImmutable`
with the timezone specified in the context, set the
``DateTimeNormalizer::FORCE_TIMEZONE_KEY`` context option to
``true``. This will force the timezone of the context and ignores any
timezone from the input.

To convert the objects to integers or floats, set the serializer
context option ``DateTimeNormalizer::CAST_KEY`` to ``int`` or
``float``.
Expand All @@ -1381,6 +1387,10 @@ normalizers (in order of priority):

The ``DateTimeNormalizer::CAST_KEY`` context option was introduced in Symfony 7.1.

.. versionadded:: 7.4

The ``DateTimeNormalizer::FORCE_TIMEZONE_KEY`` context option was introduced in Symfony 7.4.

:class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer`
This normalizer converts objects that implement
:class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface`
Expand Down