export function parseKustoTimestampToMillis()

in packages/azure-kusto-data/src/timeUtils.ts [11:25]


export function parseKustoTimestampToMillis(t: string | null): number | null {
    if (t == null || t === "") {
        return null;
    }
    const match = TimespanRegex.exec(t);
    if (match) {
        const sign = match[1] === "-" ? -1 : 1;
        const days = parseInt(match[2] || "0", 10);
        const hours = parseInt(match[3], 10);
        const minutes = parseInt(match[4], 10);
        const seconds = parseFloat(match[5]);
        return sign * 1000 * (days * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60 + seconds);
    }
    throw new Error(`Timespan value '${t}' cannot be decoded`);
}