import { array } from "../types"; /** * Convert date and time to a serial date number (Unix). * * Converts a given date and time to a Unix timestamp (serial date number). The function supports both date strings with a format and numeric arrays representing components of date and time. * * @param d The date input, which can be a single value or an array of date components. * @param fmt The format string to parse the date if the input is a date string. * @returns The Unix timestamp or an array of Unix timestamps. * * @example Convert a date string to a Unix timestamp * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(datenum('31-12-2014', 'DD-MM-YYYY'), 1419984000); * * ``` * * @example Convert an array of date strings to an array of Unix timestamps * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(datenum(['31-12-2014', '31-01-2015'], 'DD-MM-YYYY'), [1419984000, 1422662400]); * * ``` * * @example Convert an array of date components to a Unix timestamp * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(datenum([2015, 4, 5, 12, 20, 30, 0]), 1428236430); * * ``` */ export default function datenum(d: string | array, fmt?: string): number | array; //# sourceMappingURL=datenum.d.ts.map