@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
24 lines • 1.59 kB
TypeScript
import { type Zone } from './timezone.ts';
/** The UTC day `ts` (epoch milliseconds) falls on, as `YYYY-MM-DD`. */
export declare function utcDateFolder(ts: number): string;
/** UTC ISO text: whole seconds, or six fraction digits, matching Python to_iso_z. */
export declare function toIsoZ(date: Date): string;
export declare function nowIso(): string;
export declare function epochToIso(seconds: number): string;
export declare function isoToEpoch(iso: string): number;
export declare function isoTimestamp(value: string | null | undefined): number | null;
export declare function inMtimeWindow(timestamp: number | null | undefined, mtimeMin: number | null | undefined, mtimeMax: number | null | undefined): boolean;
/**
* Parse a free-form date expression as `date -d` reads it, or null for date's
* `invalid date`. The grammar is coreutils 9.7's as measured on
* debian:stable-slim: calendar dates (`2026-01-15`, `1/15/26`, `15 Jan 2026`,
* `Jan 15, 2026`, `20260115`), times of day (`10:30:45.5`, `9pm`) with zone
* corrections (`+05:30`), zone names (`UTC`, `EST DST`, `UTC+3`, military
* letters), days of the week (`next monday`), relative items (`2 days ago`,
* `tomorrow`), `@epoch` and a leading `TZ="zone"`, with parenthesized
* comments ignored. Mirage also refuses a moment outside years 1-9999, which
* date shows. Mirrors Python's parse_date_expr.
*/
export declare function parseDateExpr(text: string, zone: Zone, now?: Date): Date | null;
export declare function parsePosixTime(text: string, zone: Zone, now?: Date): Date | null;
//# sourceMappingURL=dates.d.ts.map