Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac6282f

Browse files
Listed the geographical zones defined by PHP
1 parent 135c5ff commit ac6282f

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

reference/constraints/Timezone.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,33 @@ zone
105105

106106
**type**: ``string`` **default**: ``\DateTimeZone::ALL``
107107

108-
The geographical zone in which to validate the timezone identifier.
109-
110-
Value must be any of the `DateTimeZone`_ class constants values.
108+
Set this option to any of the following constants to restrict the valid timezone
109+
identifiers to the ones that belong to that geographical zone:
110+
111+
* ``\DateTimeZone::AFRICA``
112+
* ``\DateTimeZone::AMERICA``
113+
* ``\DateTimeZone::ANTARCTICA``
114+
* ``\DateTimeZone::ARCTIC``
115+
* ``\DateTimeZone::ASIA``
116+
* ``\DateTimeZone::ATLANTIC``
117+
* ``\DateTimeZone::AUSTRALIA``
118+
* ``\DateTimeZone::EUROPE``
119+
* ``\DateTimeZone::INDIAN``
120+
* ``\DateTimeZone::PACIFIC``
121+
122+
The special ``\DateTimeZone::ALL`` zone accepts any timezone.
111123

112124
countryCode
113125
~~~~~~~~~~~
114126

115127
**type**: ``string`` **default**: ``null``
116128

117-
This option must be used only when the ``zone`` option value equals ``\DateTimeZone::PER_COUNTRY``.
118-
119-
The ``countryCode`` option enables to validate the timezone identifier is supported by the country code.
129+
If the ``zone`` option is set to ``\DateTimeZone::PER_COUNTRY``, this option
130+
restricts the valid timezone identifiers to the ones that belong to the given
131+
country.
120132

121-
Value must be a valid `ISO 3166-1 alpha-2`_ country code (e.g. ``BE``).
133+
The value of this option must be a valid `ISO 3166-1 alpha-2`_ country code
134+
(e.g. ``CN`` for China).
122135

123136
.. _`DateTimeZone`: https://www.php.net/datetimezone
124137
.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

0 commit comments

Comments
 (0)