File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1373,6 +1373,12 @@ normalizers (in order of priority):
13731373 `RFC 3339 `_ format. Use ``DateTimeNormalizer::FORMAT_KEY `` and
13741374 ``DateTimeNormalizer::TIMEZONE_KEY `` to change the format.
13751375
1376+ To always create :phpclass: `DateTime ` and :phpclass: `DateTimeImmutable `
1377+ with the timezone specified in the context, set the
1378+ ``DateTimeNormalizer::PRESERVE_CONTEXT_TIMEZONE_KEY `` context option to
1379+ ``true ``. This will preserve the timezone of the context and ignores any
1380+ timezone from the input.
1381+
13761382 To convert the objects to integers or floats, set the serializer
13771383 context option ``DateTimeNormalizer::CAST_KEY `` to ``int `` or
13781384 ``float ``.
@@ -1381,6 +1387,10 @@ normalizers (in order of priority):
13811387
13821388 The ``DateTimeNormalizer::CAST_KEY `` context option was introduced in Symfony 7.1.
13831389
1390+ .. versionadded :: 7.3
1391+
1392+ The ``DateTimeNormalizer::PRESERVE_CONTEXT_TIMEZONE_KEY `` context option was introduced in Symfony 7.3.
1393+
13841394:class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ ConstraintViolationListNormalizer `
13851395 This normalizer converts objects that implement
13861396 :class: `Symfony\\ Component\\ Validator\\ ConstraintViolationListInterface `
You can’t perform that action at this time.
0 commit comments