timestamp_convert
Convert Unix timestamps to ISO 8601 dates and vice versa. Auto-detects input type and direction, accepts seconds or milliseconds.
Instructions
Convert between Unix timestamps (seconds) and ISO 8601 date strings. Auto-detects direction: numeric input → ISO string, date string input → Unix seconds. Accepts Unix in seconds or milliseconds (auto-detected by magnitude). Returns an error if the input cannot be parsed as a timestamp or date. Has no side effects. Free. Use when you need to convert epoch values to human-readable dates or vice-versa.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | "iso" to force output as ISO 8601, "unix" to force output as Unix seconds. Omit to auto-detect. | |
| input | Yes | The value to convert. Either a Unix timestamp (as a number or numeric string, seconds or ms) or an ISO/date string like "2024-01-15T10:30:00Z". |