API formatter
Parse and pretty-print JSON payloads. Invalid documents show an error below.
Related Guides & Tutorials
// developers also readGraphQL Subscriptions with Real-Time Timestamps
Format and transmit timestamps in GraphQL APIs using subscriptions and real-time data.
Webhook Timestamp Security
Sign and verify API timestamps to prevent replay attacks in your webhook endpoints.
Rate Limiting with Unix Timestamps
Implement API rate limiting using Unix timestamps for accurate sliding window calculations.
Terminal Equivalent
Produce ISO and RFC 3339 strings from the shell for headers, JWT claims, and JSON APIs.
# Format timestamp for API response using curl + jq
curl -s api.example.com/data | \
jq '.timestamp | strftime("%Y-%m-%dT%H:%M:%SZ")'
# Generate ISO 8601 timestamp for API call
date -u +"%Y-%m-%dT%H:%M:%SZ"
# RFC 3339 format (used by Google APIs)
date -u +"%Y-%m-%dT%H:%M:%S+00:00"
# Unix ms timestamp for JavaScript APIs
date +%s%3NLanguage Quick Reference
# Python — format for REST API from datetime import datetime, timezone ts = 1733569200 iso = datetime.fromtimestamp(ts, tz=timezone.utc).isoformat() print(iso) # 2024-12-07T04:00:00+00:00
How It Works
REST APIs commonly use ISO 8601 (2024-12-07T04:00:00Z) because it's human-readable, sortable as a string, and unambiguous. GraphQL typically uses Unix timestamps as integers for efficiency. AWS uses ISO 8601 with milliseconds. Stripe uses Unix seconds. Always check the API docs — sending milliseconds to an endpoint expecting seconds will produce dates 1000x in the future.