TrueTime
by @cccat6
Ensure real-time accurate scheduling and planning across UTC, server time, NTP-sourced time, user local time, and arbitrary time zones. Use for timers, remin...
clawhub install truetimeπ About This Skill
name: truetime description: Ensure real-time accurate scheduling and planning across UTC, server time, NTP-sourced time, user local time, and arbitrary time zones. Use for timers, reminders, cron planning, in X minutes or months or years calculations, absolute timestamp conversion, Chinese lunar date awareness, and cross-timezone coordination. Enforce exact duration fidelity so user values are never replaced by example values, compute target times in UTC first, and verify deltas before execution.
TrueTime
Use this skill to avoid time mistakes caused by stale examples, wrong units, timezone drift, or DST confusion.
Non-Negotiable Rules
Required Workflow
1. Extract timing intent exactly.
- Capture literal phrase, value, unit, timezone hint, and target date/time.
- Keep the original requested value unchanged (for example 1 minute stays 1 minute).
2. Read current real time.
- Use the bundled script for deterministic calculations:
- Relative: node {baseDir}/scripts/true_time.mjs --plus 1m --user-tz Asia/Shanghai
- Relative (calendar units): node {baseDir}/scripts/true_time.mjs --plus 1month2weeks --user-tz America/New_York --calendar-tz America/New_York
- Absolute: node {baseDir}/scripts/true_time.mjs --target 2026-02-17T09:30:00 --target-tz Asia/Shanghai --user-tz America/Los_Angeles
- NTP time source: node {baseDir}/scripts/true_time.mjs --plus 1h --time-source ntp
3. Parse the expression into one precise delta or one precise absolute timestamp.
4. Compute UTC target first.
5. Convert UTC target to server/user/other requested timezone for presentation.
6. Verify the result before execution.
- Confirm target_utc - now_utc equals requested delta.
- Confirm timezone offset conversion is consistent.
7. Execute schedules using UTC unless the target scheduler explicitly needs local timezone.
8. Report both absolute and relative interpretation in the final response.
Relative Time Guardrails
ms, msec, msecs, millisecond, milliseconds
- seconds: s, sec, second, seconds
- minutes: m, min, minute, minutes
- hours: h, hr, hour, hours
- days: d, day, days
- weeks: w, week, weeks
- months: mo, mon, month, months
- years: y, yr, year, years
- decades: decade, decades
- centuries: century, centuries
1.5m, 0.25h, 2.5day, 250.5ms, 1.5month, 0.1year, 0.5decade, 0.01century.
- Decimal separator . is preferred; , is accepted as input and normalized.
month/year/decade/century are calendar-aware, not fixed seconds.
- Calendar arithmetic uses --calendar-tz (fallback: user timezone -> server timezone).
- Decimal calendar values are split into integer and fractional parts.
- Integer months use calendar shift; fractional months use the shifted month length to compute milliseconds.
- End-of-month handling clamps to the last valid day (for example Jan 31 + 1 month -> Feb 28/29).
1.5m = 90s
- 250ms = 0.25s
- 1m = 60s
- 1h30m = 5400s
- 2d = 172800s
- 1.5year = 18 months
- 1decade = 10 years
- 0.5decade = 5 years
- 1century = 100 years
- 0.01century = 1 yearAbsolute Time Guardrails
Asia/Shanghai, America/Los_Angeles, UTC).CST, IST) unless user confirms meaning.Timezone Catalog and Customization
node {baseDir}/scripts/true_time.mjs --list-timezones
node {baseDir}/scripts/true_time.mjs --list-timezones | rg -i '^(UTC|Asia/(Shanghai|Tokyo|Kolkata)|America/(Los_Angeles|New_York)|Europe/(London|Paris|Berlin))$'
--list-timezones.
- Pass user timezone via --user-tz .
- If user timezone is unknown, ask before executing time-sensitive actions.Common timezones to use in examples and user-facing confirmations:
UTC (no DST)Asia/Shanghai (Beijing time, UTC+08:00, no DST)Asia/Tokyo (Tokyo time, UTC+09:00, no DST)Asia/Kolkata (India time, UTC+05:30, no DST)America/Los_Angeles (US West: PST UTC-08:00 / PDT UTC-07:00, DST applies)America/New_York (US East: EST UTC-05:00 / EDT UTC-04:00, DST applies)America/Chicago (US Central: CST UTC-06:00 / CDT UTC-05:00, DST applies)America/Denver (US Mountain: MST UTC-07:00 / MDT UTC-06:00, DST applies)America/Phoenix (Arizona: MST UTC-07:00, typically no DST)America/Anchorage (Alaska: AKST UTC-09:00 / AKDT UTC-08:00, DST applies)Pacific/Honolulu (Hawaii: HST UTC-10:00, no DST)Europe/London (UK: GMT UTC+00:00 / BST UTC+01:00, DST applies)Europe/Paris (CET UTC+01:00 / CEST UTC+02:00, DST applies)Europe/Berlin (CET UTC+01:00 / CEST UTC+02:00, DST applies)Europe/Amsterdam (CET UTC+01:00 / CEST UTC+02:00, DST applies)DST and Standard-Time Rules
America/*, many Europe/*).2026-11-01T01:30:00 in America/Los_Angeles is ambiguous.
- Ask user to choose -07:00 (before fallback) or -08:00 (after fallback), or provide explicit offset in --target.
2026-03-08T02:30:00 in America/Los_Angeles does not exist.
- Ask user to use a valid local time (for example 01:30 or 03:30).
--target 2026-11-01T01:30:00-07:00
- --target 2026-11-01T01:30:00-08:00Chinese Lunar Calendar
lunar_timezone (default Asia/Shanghai, configurable via --lunar-tz)
- now_lunar
- target_lunar
Time Source Policy (Server vs NTP)
--time-source server).--time-source ntp
--ntp-server (repeatable or comma-separated)
- --ntp-timeout-ms
node {baseDir}/scripts/true_time.mjs --plus 30m --time-source ntp --ntp-server time.google.com
Mandatory Integration Points
Use TrueTime calculations before any of the following:
cron add, cron update, cron wake, cron run) when time or schedule is involved.Server Execution Policy
target_utc_iso and optionally epoch seconds).node .../true_time.mjs).openclaw-sandbox:bookworm-slim may not include Node; use openclaw-sandbox-common:bookworm-slim or install Node in agents.defaults.sandbox.docker.setupCommand.High-Frequency Examples
Relative calculations:
node {baseDir}/scripts/true_time.mjs --plus 1m --user-tz Asia/Shanghai
node {baseDir}/scripts/true_time.mjs --plus 1.5m --user-tz Asia/Shanghai
node {baseDir}/scripts/true_time.mjs --plus 250.5ms --user-tz Asia/Tokyo
node {baseDir}/scripts/true_time.mjs --plus 1h30m --user-tz Asia/Tokyo
node {baseDir}/scripts/true_time.mjs --plus 2h --user-tz America/Los_Angeles
node {baseDir}/scripts/true_time.mjs --plus 45m --user-tz America/New_York
node {baseDir}/scripts/true_time.mjs --plus 1d --user-tz Asia/Kolkata
node {baseDir}/scripts/true_time.mjs --plus 1month --user-tz America/Chicago --calendar-tz America/Chicago
node {baseDir}/scripts/true_time.mjs --plus 1.5month --user-tz America/Chicago --calendar-tz America/Chicago
node {baseDir}/scripts/true_time.mjs --plus 1year --user-tz America/Denver --calendar-tz America/Denver
node {baseDir}/scripts/true_time.mjs --plus 0.1year --user-tz America/Denver --calendar-tz America/Denver
node {baseDir}/scripts/true_time.mjs --plus 1decade --user-tz Pacific/Honolulu --calendar-tz Pacific/Honolulu
node {baseDir}/scripts/true_time.mjs --plus 0.5decade --user-tz Pacific/Honolulu --calendar-tz Pacific/Honolulu
node {baseDir}/scripts/true_time.mjs --plus 1century --user-tz UTC --calendar-tz UTC
node {baseDir}/scripts/true_time.mjs --plus 0.01century --user-tz UTC --calendar-tz UTCAbsolute and cross-timezone calculations:
node {baseDir}/scripts/true_time.mjs --target 2026-02-18T09:00:00 --target-tz Asia/Shanghai --user-tz Asia/Shanghai
node {baseDir}/scripts/true_time.mjs --target 2026-05-20T14:00:00 --target-tz Europe/London --user-tz America/New_York
node {baseDir}/scripts/true_time.mjs --target 2026-04-15T16:00:00Z --user-tz Europe/Berlin
node {baseDir}/scripts/true_time.mjs --target 2026-11-01T01:30:00-07:00 --user-tz America/Los_Angeles
- node {baseDir}/scripts/true_time.mjs --target 2026-11-01T01:30:00-08:00 --user-tz America/Los_Angeles
node {baseDir}/scripts/true_time.mjs --plus 15m --time-source ntp --user-tz Asia/ShanghaiOutput Contract
When sending or scheduling time-sensitive actions, always include:
now_utctarget_utctarget_user_tz (if known)target_server_tzdelta_millisecondsdelta_secondstime_source (server | ntp | override)ntp_server (when time_source=ntp)now_lunartarget_lunarDo not continue with execution when any required field is unknown and may change the target time materially.