Unix Timestamp to Human-Readable Date
Unix timestamps are great for computers, terrible for humans. Convert to a friendly format like 'January 31, 2024 12:00 PM' for emails, UI labels, and reports.
Example: 1706745600
| Unix (seconds) | 1706745600 |
|---|---|
| Unix (milliseconds) | 1706745600000 |
| ISO 8601 (UTC) | 2024-02-01T00:00:00Z |
| RFC 2822 | Thu, 01 Feb 2024 00:00:00 GMT |
| Human Readable | February 1, 2024 12:00:00 AM UTC |
Common Pitfall
Note: Human-readable dates are inherently locale-specific. 'January 31, 2024' is US-standard; many locales use 31 January 2024. Use `Intl.DateTimeFormat` (JS) or `babel.dates.format_datetime` (Python) for locale-correct output.
Code Examples
Python
from datetime import datetime, timezone
datetime.fromtimestamp(1706745600, tz=timezone.utc).strftime('%B %d, %Y %I:%M %p UTC')
JavaScript
new Date(1706745600 * 1000).toUTCString()
PHP
gmdate('F d, Y g:i A', 1706745600);
Java
Instant.ofEpochSecond(1706745600L).atZone(ZoneOffset.UTC)
.format(DateTimeFormatter.ofPattern("MMMM d, yyyy h:mm a 'UTC'"))
Go
time.Unix(1706745600, 0).UTC().Format("January 2, 2006 3:04 PM")