@technobuddha > library > Time > Time Zone
Function: timezone()
ts
function timezone(input:
| number
| Date, options: TimezoneOptions): string;Defined in: timezone.ts:29
Determine the correct timezone string for a specified date using a local timezone, or an offset in minutes
Parameters
| Parameter | Type | Description |
|---|---|---|
input | | number | Date | The date, or a timezone offset in minutes |
options | TimezoneOptions | see TimezoneOptions |
Returns
string
the timezone offset formatted like '±hh:mm' the string is prefixed by 'gmt' if the option is set. If the z option is set 'z' is returned for the gmt+00:00 timezone
Remarks
the gmt flag overrides the z flag if both are set
Default Value
ts
gmt falseDefault Value
ts
z true