datenum(d: string | array<string | number>,fmt?: string,): number | array
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.
Convert a date string to a Unix timestamp
Convert a date string to a Unix timestamp
import { assertEquals } from "jsr:@std/assert"; assertEquals(datenum('31-12-2014', 'DD-MM-YYYY'), 1419984000);
d: string | array<string | number>
The date input, which can be a single value or an array of date components.
number | array
The Unix timestamp or an array of Unix timestamps.