Report

Help us improve this tool

Strftime Playground

Test C and Python strftime format strings against a datetime and see live output with a directive reference.

O M T

Preview C and Python strftime format strings

The strftime family of format codes appears in C libraries, Python time.strftime, Ruby, PHP, and countless log pipelines. This playground applies your format string to a chosen datetime and shows the rendered text immediately, with an optional UTC mode that uses UTC getters instead of local time.

When to use UTC mode

Server logs and APIs usually store instants in UTC. Toggle UTC when you are formatting a stored UTC instant without shifting it through the browser's local offset. Leave UTC off when you want wall-clock output for a local calendar picker value.

For epoch conversions, pair this with the Epoch Unix Timestamp Converter or Unix Nanoseconds Converter. For human phrases like "3 hours ago", try the Relative Time Formatter.

Frequently Asked Questions

Which directives are supported?

Common specifiers such as %Y, %m, %d, %H, %I, %p, %A, and %B are implemented in English. Unknown codes return an error instead of silent garbage output.

Is this identical to every language runtime?

Locale-specific %c/%x output uses a fixed US-style pattern. Always verify edge cases (week numbers, time zones) against your target runtime before shipping to production.

Does formatting happen on your servers?

No. Dates and format strings are processed locally in your browser; nothing is uploaded.