Skip to content
Back to skills

Sandbox Dates

ASecurity

Date arithmetic, parsing and formatting inside a Code node or CodeAct action, with date-fns running in the guest

  • 552 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 1, 2026
ai-agentsgonodedatabase

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add nodetool-ai/nodetool --skill sandbox-dates --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox Dates?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sandbox Dates
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nodetool-ai-sandbox-dates/badge)](https://www.skillsdirectory.com/skills/nodetool-ai-sandbox-dates)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sandbox-dates
description: Date arithmetic, parsing and formatting inside a Code node or CodeAct action, with date-fns running in the guest
---

# Dates in the sandbox

Specifier: `@nodetool-ai/sandbox-dates`. One module, date-fns's root export —
around 250 named functions. There is no default export, so import the names you
use.

## Arithmetic and comparison

```js
import { addDays, differenceInCalendarDays, isBefore } from "@nodetool-ai/sandbox-dates";

const due = addDays(new Date(inputs.startedAt), 30);
return { due: due.toISOString(), overdue: isBefore(due, new Date()), days: differenceInCalendarDays(due, new Date()) };
```

## Parsing and formatting

```js
import { parseISO, format, isValid } from "@nodetool-ai/sandbox-dates";

const when = parseISO(inputs.timestamp);
if (!isValid(when)) return { label: "unknown" };
return { label: format(when, "EEEE, d MMMM yyyy") };
```

`format` uses date-fns's own English locale tables, not `Intl` — which the
guest does not have. That is why formatting works here at all, and it is also
the limit: another language means another locale, and locales live at
`date-fns/locale`, a subpath this pack does not publish.

## Gotchas

- **UTC only.** The guest runs with no time-zone database, so `new Date()` and
  every conversion behave as UTC. Anything zone-aware — "9 am in Berlin" —
  belongs on the host, not here.
- **Named imports only.** `import dates from "@nodetool-ai/sandbox-dates"` gets
  you nothing; date-fns is pure ESM with no default export.
- **Import what you use.** The bundle is about 176 KB and loads as one module
  per invocation, so a node that needs one comparison pays for all of it. For a
  single `Date` subtraction, plain arithmetic is cheaper.
- **No timers.** `setTimeout` does not exist in the guest. date-fns needs none,
  but code around it must not either.

Files in this skill

  • SKILL.md1.8 KB
  • package.json870 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.