Unix Timestamp Converter
Live Unix clock and three converters: timestamp to date, date string to timestamp, and separate date fields, with seconds or milliseconds.
Convert in your browser · No sign-up
Current Unix timestamp
- Seconds
- —
- Milliseconds
- —
Updates every second
Use YYYY-MM-DD HH:mm:ss, optionally .SSS or an explicit Z / ±HH:mm offset. An explicit offset overrides the selected zone.
Get the current Unix timestamp
| Language | Code example |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | import time int(time.time()) |
| PHP | time() |
| Java | java.time.Instant.now().getEpochSecond() |
| Go | import "time" time.Now().Unix() |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| PostgreSQL | SELECT FLOOR(EXTRACT(EPOCH FROM NOW())); |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| Linux (GNU date) | date +%s |
Convert a timestamp to a date
| Language | Code example |
|---|---|
| JavaScript | new Date(1767225600 * 1000).toISOString() |
| Python | from datetime import datetime, timezone datetime.fromtimestamp(1767225600, timezone.utc).isoformat() |
| PHP | gmdate('Y-m-d H:i:s', 1767225600) |
| Java | java.time.Instant.ofEpochSecond(1767225600L) |
| Go | time.Unix(1767225600, 0).UTC() |
| MySQL | SET time_zone = '+00:00'; SELECT FROM_UNIXTIME(1767225600); |
| PostgreSQL | SET TIME ZONE 'UTC'; SELECT TO_TIMESTAMP(1767225600); |
| C# | DateTimeOffset.FromUnixTimeSeconds(1767225600) |
| Linux (GNU date) | date -u -d @1767225600 |
Convert a date to a timestamp
| Language | Code example |
|---|---|
| JavaScript | Math.floor(new Date("2026-01-01T00:00:00Z").getTime() / 1000) |
| Python | from datetime import datetime, timezone int(datetime(2026, 1, 1, tzinfo=timezone.utc).timestamp()) |
| PHP | (new DateTimeImmutable('2026-01-01T00:00:00Z'))->getTimestamp() |
| Java | java.time.Instant.parse("2026-01-01T00:00:00Z").getEpochSecond() |
| Go | time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC).Unix() |
| MySQL | SET time_zone = '+00:00';
SELECT UNIX_TIMESTAMP('2026-01-01 00:00:00'); |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM TIMESTAMPTZ '2026-01-01 00:00:00+00'); |
| C# | new DateTimeOffset(2026, 1, 1, 0, 0, 0, TimeSpan.Zero).ToUnixTimeSeconds() |
| Linux (GNU date) | date -u -d '2026-01-01 00:00:00' +%s |
How to use
- Time zone: UTC / UTC+08:00 / UTC+09:00
- Timestamp → date / Date string → timestamp / Date fields → timestamp
- Unit: Seconds / Milliseconds
Example
UTC: 1767225600 s ⇄ 2026-01-01 00:00:00.000 UTC+08:00: 1767225600000 ms ⇄ 2026-01-01 08:00:00.000
Details and limitations
Use YYYY-MM-DD HH:mm:ss, optionally .SSS or an explicit Z / ±HH:mm offset. An explicit offset overrides the selected zone.
Unix time counts from 1970-01-01T00:00:00Z. One second is 1,000 milliseconds. Supported years: 0001–9999. At a repeated local DST time, the earlier occurrence is used; supply an explicit offset to choose the other.
FAQ
What are the supported inputs and limits?
Use YYYY-MM-DD HH:mm:ss, optionally .SSS or an explicit Z / ±HH:mm offset. An explicit offset overrides the selected zone. Unix time counts from 1970-01-01T00:00:00Z. One second is 1,000 milliseconds. Supported years: 0001–9999. At a repeated local DST time, the earlier occurrence is used; supply an explicit offset to choose the other.
Related tools
Format references
Tool page updated: