UNPKG

@technobuddha/library

Version:
20 lines (19 loc) 783 B
export declare type Options = { /** Display 'GMT' in time zones */ GMT?: boolean; /** Display 'Z' for the GMT time zone */ Z?: boolean; }; /** * Determine the correct timezone string for a specified date using a local timezone, or an offset in minutes * * @remarks the GMT flag overrides the Z flag if both are set * @param input The date, or a timezone offset in minutes * @param __namedParameters see {@link Options} * @default GMT false * @default Z true * @returns 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 */ export declare function getTimezone(input: Date | number, { GMT, Z }?: Options): string; export default getTimezone;