UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

19 lines (18 loc) 689 B
import { type UnixUnit } from "../validate/index.js"; /** * Return the day of week (1-7) from a unix epoch value. * * - Monday=1 through Sunday=7. * - Returns null for invalid input. * * @param value unix epoch in milliseconds or seconds (number or string) * @param options optional: epochUnit ("seconds" | "milliseconds"), timeZone (IANA) * @returns Day of week (1-7) or null on invalid input * * @example parseDayOfWeekFromUnix(1704067200000) // 1 * @example parseDayOfWeekFromUnix(-86400, { epochUnit: "seconds" }) // 2 */ export declare function parseDayOfWeekFromUnix(value: number | string, options?: { epochUnit?: UnixUnit; timeZone?: string; }): number | null;