This function determines whether the provided value is of type str and contains a valid time zone (see time_zones_info() for a list with all available time zones).
This function does not generate a change.
is_time_zone(value)
Argument | Type | Description |
---|---|---|
value | any (required) | The value to be tested. |
Returns true
if the given value is of type str
and contains a valid time zone, else false
.
This code shows some return values for is_time_zone():
[
is_time_zone( 'Europe/Amsterdam' ),
is_time_zone( '@Work' ),
];
Return value in JSON format
[
true,
false
]