chrono.
Functions
| Function | Description | Example | Result |
|---|---|---|---|
date.now() | Current time (HH:MM:SS) | date.now() | "14:30:05" |
date.today() | Current date (YYYY-MM-DD) | date.today() | "2026-02-16" |
date.timestamp() | Unix timestamp (seconds) | date.timestamp() | 1739712605 |
date.timestamp_ms() | Unix timestamp (milliseconds) | date.timestamp_ms() | 1739712605000 |
date.format(fmt) | Format current time | date.format("%H:%M") | "14:30" |
date.parse(str, fmt) | Parse date string | date.parse("2026-01-01", "%Y-%m-%d") | date value |
date.year() | Current year | date.year() | 2026 |
date.month() | Current month (1–12) | date.month() | 2 |
date.day() | Current day (1–31) | date.day() | 16 |
date.weekday() | Day of the week | date.weekday() | "Monday" |
date.sleep(ms) | Sleep for milliseconds | date.sleep(1000) |
Format Strings
Based on Cstrftime.
| Code | Meaning | Example |
|---|---|---|
%Y | 4-digit year | 2026 |
%m | Month (01–12) | 02 |
%d | Day (01–31) | 16 |
%H | Hour (00–23) | 14 |
%M | Minute (00–59) | 30 |
%S | Second (00–59) | 05 |
%A | Full weekday | Monday |
%B | Full month name | February |