---
title: "Use this when you need to know exactly what a C/POSIX strftime pattern (%Y %m %d %H %M %S %A %B %j %z etc.) produces."
method: POST
path: "/v1/strftime_preview"
tags: ["datetime"]
---

# Use this when you need to know exactly what a C/POSIX strftime pattern (%Y %m %d %H %M %S %A %B %j %z etc.) produces.

`POST /v1/strftime_preview`

## Request

- Base URL: `https://api.clean.tools`
- URL: `https://api.clean.tools/v1/strftime_preview`
- Auth: none declared

Use this when you need to know exactly what a C/POSIX strftime pattern (%Y %m %d %H %M %S %A %B %j %z etc.) produces. Prefer this over guessing the output yourself. Deterministic: same input, same output; the reference time is formatted in UTC (%Z is 'UTC', %z is '+0000', defaults to current time when datetime is omitted). Unknown directives pass through literally. Example: {format:'%A, %B %e, %Y at %I:%M %p', datetime:'2026-07-08T14:30:45'} -> 'Wednesday, July  8, 2026 at 02:30 PM'.

## Request body

- object
  - `format` string, required: strftime format string, e.g. "%A, %B %e, %Y at %I:%M %p".
  - `datetime` string: Optional ISO date-time to format (default: current time).
  - `now` string: Alias for the reference time when datetime is omitted.

## Response `200`

Structured tool result.

- object
  - `tool` string
  - `result` object
    - `format` string, required: Echo of the strftime format string.
    - `datetimeUtc` string, required: The reference date-time that was formatted, ISO-8601 UTC.
    - `output` string, required: The formatted result; unknown directives are emitted literally as '%X'.

## Other responses

- `400`: Invalid input or the tool reported an error.
- `413`: Request body exceeds the 128 KB limit.
- `429`: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.

---

[API](https://skmtc.dev/clean/apis/clean-tools-api.md) · [All operations](https://skmtc.dev/clean/apis/clean-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/clean/apis/clean-tools-api/revisions/a24a01d2833c?raw)
