Convert Unix epoch timestamps to human-readable dates or convert local date and time values to epoch seconds.
Runs locally in your browserA Unix timestamp counts elapsed seconds from 1970-01-01 00:00:00 UTC. This page interprets date and time input in the browser's local time zone.
Store timestamps in UTC. Apply a named IANA time zone, including daylight-saving rules, only when displaying a value to a user.
| Environment | Current timestamp | Convert timestamp to UTC date and time |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(timestamp * 1000).toISOString() |
| Python | int(time.time()) | datetime.fromtimestamp(timestamp, timezone.utc) |
| PHP | time() | (new DateTimeImmutable("@$timestamp"))->setTimezone(new DateTimeZone("UTC")) |
| Java | Instant.now().getEpochSecond() | Instant.ofEpochSecond(timestamp) |
| Go | time.Now().Unix() | time.Unix(timestamp, 0).UTC() |
| Ruby | Time.now.to_i | Time.at(timestamp).utc |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM NOW())::bigint; | SELECT TO_TIMESTAMP(timestamp) AT TIME ZONE 'UTC'; |
| MySQL | SELECT UNIX_TIMESTAMP(); | SELECT FROM_UNIXTIME(timestamp); |