UNPKG

datezone

Version:

A lightweight and comprehensive date and timeZone utility library for JavaScript.

41 lines 1.5 kB
import { type TimeZone } from "./timezone.pub.js"; /** * Get UTC to timezone offset minutes. * * @param ts - Timestamp in milliseconds * @param tz - Target timezone (null/undefined for local) * @returns Offset in minutes (positive if ahead of UTC, negative if behind) * @see https://datezone.dev/docs/reference/offset#getutctotimezoneoffsetminutes */ export declare function getUTCtoTimezoneOffsetMinutes(ts: number, tz: TimeZone): number; /** * Get UTC to local timezone offset minutes. * * @param ts - Timestamp in milliseconds * @returns Offset in minutes (positive if ahead of UTC, negative if behind) * @see https://datezone.dev/docs/reference/offset#getutctolocaloffsetminutes */ export declare function getUTCtoLocalOffsetMinutes(ts: number): number; /** * Get timezone offset minutes. * * @see https://datezone.dev/docs/reference/offset#gettimezoneoffsetminutes */ export declare function getTimezoneOffsetMinutes(ts: number, fromZone?: TimeZone, toZone?: TimeZone): number; /** * Get fixed offset cache info. * * @returns Object containing cache size and cached timeZones * @see https://datezone.dev/docs/reference/offset#getfixedoffsetcacheinfo */ export declare function getFixedOffsetCacheInfo(): { size: number; cachedTimezones: TimeZone[]; }; /** * Clear fixed offset cache. * * @see https://datezone.dev/docs/reference/offset#clearfixedoffsetcache */ export declare function clearFixedOffsetCache(): void; //# sourceMappingURL=offset.pub.d.ts.map