/temporal — concrete date ranges, relative to now
This is the single source of truth for "what dates does mean right
now?". It resolves named windows to concrete ISO date ranges relative to your
run time (new Date() at the moment you invoke it), so you never re-derive
dates manually. It only reads the clock and prints — no files written, no network.
Run it
# all windows at once (a quick temporal-context dump)
node "$AGENT_DIR/.claude/skills/temporal/when.mjs"
# one or several specific windows
node "$AGENT_DIR/.claude/skills/temporal/when.mjs" last30Days thisQuarter
# JSON only (machine-readable), or list the supported keywords
node "$AGENT_DIR/.claude/skills/temporal/when.mjs" --json last7Days
node "$AGENT_DIR/.claude/skills/temporal/when.mjs" --list
If $AGENT_DIR is somehow unset, the script also lives under
~/.claude/skills/temporal/when.mjs.
Windows
| Keyword |
Meaning |
today / yesterday |
the single civil day |
thisWeek / lastWeek |
ISO week (Mon-start); this = Mon→today, last = the full prior Mon→Sun |
last7Days / last30Days / last90Days |
rolling N-day window ending today (inclusive) |
thisMonth / lastMonth |
this = 1st→today; last = the full prior calendar month |
thisQuarter / lastQuarter |
this = quarter-start→today; last = the full prior quarter |
thisYear / lastYear |
this = Jan 1→today (YTD); last = the full prior year |
last12Months |
rolling 12 months ending today |
lastNdays / lastNweeks / lastNmonths |
arbitrary rolling window, e.g. last45days, last2weeks, last6months |
Aliases: ytd, qtd, mtd, wtd, 7d, 30d, 90d, 12m.
Convention: this* windows are period-start → today (to-date); last*
named periods are the full prior complete period.
Output
Each window prints a human line plus a JSON record:
start / end — inclusive civil dates (YYYY-MM-DD) in your local timezone
startUtc / endExclusiveUtc — the same span as a half-open [start, end)
range of exact UTC instants, ideal for timestamp / createdAt-style queries
days, inclusive, timezone, tzOffsetMinutes, asOf — span, tz, and the
instant the range was resolved
Use the returned dates as the time bounds for the task. The named shortcuts
/today, /yesterday, /last30Days, /lastQuarter, … each call this same
resolver for their one window.
1---2name: temporal3description: Resolve ANY named time window — today, yesterday, thisWeek, lastWeek, last7Days, last30Days, last90Days, thisMonth, lastMonth, thisQuarter, lastQuarter, thisYear, lastYear, last12Months — or an arbitrary range (lastNdays / lastNweeks / lastNmonths) to a concrete ISO date range relative to your run time. Read-only: no writes, no network. Use whenever a task is time-scoped and you need exact start/end dates without computing them by hand.4---56## /temporal — concrete date ranges, relative to now78This is the single source of truth for "what dates does *<window>* mean right9now?". It resolves named windows to **concrete ISO date ranges relative to your10run time** (`new Date()` at the moment you invoke it), so you never re-derive11dates manually. It only reads the clock and prints — no files written, no network.1213### Run it1415```bash16# all windows at once (a quick temporal-context dump)17node "$AGENT_DIR/.claude/skills/temporal/when.mjs"1819# one or several specific windows20node "$AGENT_DIR/.claude/skills/temporal/when.mjs" last30Days thisQuarter2122# JSON only (machine-readable), or list the supported keywords23node "$AGENT_DIR/.claude/skills/temporal/when.mjs" --json last7Days24node "$AGENT_DIR/.claude/skills/temporal/when.mjs" --list25```2627If `$AGENT_DIR` is somehow unset, the script also lives under28`~/.claude/skills/temporal/when.mjs`.2930### Windows3132| Keyword | Meaning |33| --- | --- |34| `today` / `yesterday` | the single civil day |35| `thisWeek` / `lastWeek` | ISO week (Mon-start); *this* = Mon→today, *last* = the full prior Mon→Sun |36| `last7Days` / `last30Days` / `last90Days` | rolling N-day window ending today (inclusive) |37| `thisMonth` / `lastMonth` | *this* = 1st→today; *last* = the full prior calendar month |38| `thisQuarter` / `lastQuarter` | *this* = quarter-start→today; *last* = the full prior quarter |39| `thisYear` / `lastYear` | *this* = Jan 1→today (YTD); *last* = the full prior year |40| `last12Months` | rolling 12 months ending today |41| `lastNdays` / `lastNweeks` / `lastNmonths` | arbitrary rolling window, e.g. `last45days`, `last2weeks`, `last6months` |4243Aliases: `ytd`, `qtd`, `mtd`, `wtd`, `7d`, `30d`, `90d`, `12m`.4445Convention: `this*` windows are **period-start → today** (to-date); `last*`46named periods are the **full prior complete period**.4748### Output4950Each window prints a human line plus a JSON record:5152- `start` / `end` — inclusive civil dates (`YYYY-MM-DD`) in your local timezone53- `startUtc` / `endExclusiveUtc` — the same span as a half-open `[start, end)`54 range of exact UTC instants, ideal for timestamp / `createdAt`-style queries55- `days`, `inclusive`, `timezone`, `tzOffsetMinutes`, `asOf` — span, tz, and the56 instant the range was resolved5758Use the returned dates as the time bounds for the task. The named shortcuts59`/today`, `/yesterday`, `/last30Days`, `/lastQuarter`, … each call this same60resolver for their one window.