class TimezoneController (View source)

Provides a callback for finding out a timezone name.

Methods

JsonResponse
getTimezone(string $abbreviation = '', int $offset = -1, null|bool $is_daylight_saving_time = NULL)

Retrieve a JSON object containing a time zone name given a timezone abbreviation.

Details

JsonResponse getTimezone(string $abbreviation = '', int $offset = -1, null|bool $is_daylight_saving_time = NULL)

Retrieve a JSON object containing a time zone name given a timezone abbreviation.

Parameters

string $abbreviation

Time zone abbreviation.

int $offset

Offset from GMT in seconds. Defaults to -1 which means that first found time zone corresponding to abbr is returned. Otherwise exact offset is searched and only if not found then the first time zone with any offset is returned.

null|bool $is_daylight_saving_time

Daylight saving time indicator. If abbr does not exist then the time zone is searched solely by offset and isdst.

Return Value

JsonResponse

The timezone name in JsonResponse object.