Unix timestamp converter
Epoch to date and date to epoch, in seconds, milliseconds, microseconds or nanoseconds. All conversion happens in your browser.
Current Unix time (seconds)
1794715542
Milliseconds: 1794715542796
Get the current Unix timestamp in code
| Language | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | import time; int(time.time()) |
| PHP | time() |
| Java | Instant.now().getEpochSecond() |
| Go | time.Now().Unix() |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| Ruby | Time.now.to_i |
| Rust | SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| PostgreSQL | SELECT EXTRACT(EPOCH FROM NOW()); |
| SQLite | SELECT strftime('%s', 'now'); |
| Bash (Linux, macOS) | date +%s |
| PowerShell | [DateTimeOffset]::UtcNow.ToUnixTimeSeconds() |
Convert a timestamp to a date in code
| Language | Code |
|---|---|
| JavaScript | new Date(ts * 1000).toISOString() |
| Python | datetime.fromtimestamp(ts, tz=timezone.utc) |
| PHP | gmdate('c', $ts) |
| Java | Instant.ofEpochSecond(ts) |
| Go | time.Unix(ts, 0).UTC() |
| C# | DateTimeOffset.FromUnixTimeSeconds(ts) |
| MySQL | SELECT FROM_UNIXTIME(ts); |
| PostgreSQL | SELECT to_timestamp(ts); |
| Bash (GNU date) | date -u -d @1763174400 |
| Bash (macOS) | date -u -r 1763174400 |
ts is a timestamp in seconds. JavaScript works in milliseconds, so multiply by
1,000.
Notable Unix timestamps
| Timestamp | Date (UTC) | Why it matters |
|---|---|---|
0 | 1970-01-01T00:00:00Z | The Unix epoch |
1000000000 | 2001-09-09T01:46:40Z | One billion seconds |
1234567890 | 2009-02-13T23:31:30Z | 1234567890 |
1500000000 | 2017-07-14T02:40:00Z | 1.5 billion seconds |
2000000000 | 2033-05-18T03:33:20Z | Two billion seconds |
2147483647 | 2038-01-19T03:14:07Z | Year 2038 problem: the largest signed 32-bit value |
Frequently asked questions
What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is the same everywhere in the world at a given moment, which makes it the standard way computers store time.
Is my timestamp in seconds or milliseconds?
Count the digits. A current timestamp in seconds has 10 digits (e.g. 1763174400); in milliseconds it has 13 (JavaScript’s Date.now()); microseconds have 16 and nanoseconds 19. The converter detects this automatically, and you can override it.
What is the Year 2038 problem?
Systems that store Unix time in a signed 32-bit integer can count only up to 2,147,483,647, which is 2038-01-19 at 03:14:07 UTC. One second later the value overflows to a date in December 1901. Modern 64-bit systems are not affected.
Does Unix time include leap seconds?
No. Every Unix day is exactly 86,400 seconds. When a leap second is added to UTC, Unix time repeats or smears a second instead, so it stays aligned with UTC dates.
Does a Unix timestamp have a time zone?
No. A timestamp is a single moment, always counted from UTC. Time zones only matter when you display it: the same timestamp shows a different wall-clock time in New York and London.
More date and time tools
- Days between dates Count days, weeks and months
- Date calculator Add or subtract days, months, years
- Working days calculator Business days minus holidays
- Hours calculator Hours between two times
- Time card calculator Weekly hours, overtime and pay
- Military time converter Military time to standard and back
- Week number What week of the year it is
- Day of the year Day number, days left, Julian date
- Hours from now Clock time after X minutes or hours
- Days from now The date X days from today
- Days ago The date X days before today
- Time zone converter Convert a time between places
- Long-weekend planner Best days to take leave