Unix time now
1793707509
- Milliseconds
- 1793707509423
- Microseconds
- 1793707509000000
- Nanoseconds
- 1793707509000000000
- UTC (ISO 8601)
- 2026-11-03T12:05:09Z
Seconds since 1970-01-01 00:00:00 UTC, counted from our server’s clock, not your device’s.
Timestamp to date
Date to timestamp
Seconds to days, hours and minutes
Unix time in code
Current timestamp, timestamp to date, and date to timestamp, in UTC. The examples use 1793622375 (2026-11-02T12:26:15Z); convert another value above and they follow it.
Current Unix time
Math.floor(Date.now() / 1000) Timestamp to date
new Date(1793622375 * 1000).toISOString() Date to timestamp
Date.parse('2026-11-02T12:26:15Z') / 1000 Date works in milliseconds; divide by 1000 for seconds.
Current Unix time
Math.floor(Temporal.Now.instant().epochMilliseconds / 1000) Timestamp to date
Temporal.Instant.fromEpochMilliseconds(1793622375 * 1000).toString() Date to timestamp
Temporal.Instant.from('2026-11-02T12:26:15Z').epochMilliseconds / 1000 Temporal is new; check that your runtime ships it.
Current Unix time
import time
int(time.time()) Timestamp to date
from datetime import datetime, timezone
datetime.fromtimestamp(1793622375, tz=timezone.utc) Date to timestamp
from datetime import datetime, timezone
int(datetime(2026, 11, 2, 12, 26, 15, tzinfo=timezone.utc).timestamp()) Without tz=, fromtimestamp() returns local time and a naive datetime.
Current Unix time
Instant.now().getEpochSecond() Timestamp to date
Instant.ofEpochSecond(1793622375L) Date to timestamp
OffsetDateTime.of(2026, 11, 2, 12, 26, 15, 0, ZoneOffset.UTC).toEpochSecond() java.time (Java 8+). System.currentTimeMillis() gives milliseconds.
Current Unix time
Instant.now().epochSecond Timestamp to date
Instant.ofEpochSecond(1793622375L) Date to timestamp
OffsetDateTime.of(2026, 11, 2, 12, 26, 15, 0, ZoneOffset.UTC).toEpochSecond() Current Unix time
DateTimeOffset.UtcNow.ToUnixTimeSeconds() Timestamp to date
DateTimeOffset.FromUnixTimeSeconds(1793622375) Date to timestamp
new DateTimeOffset(2026, 11, 2, 12, 26, 15, TimeSpan.Zero).ToUnixTimeSeconds() Current Unix time
time.Now().Unix() Timestamp to date
time.Unix(1793622375, 0).UTC() Date to timestamp
time.Date(2026, time.November, 2, 12, 26, 15, 0, time.UTC).Unix() Current Unix time
SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() Timestamp to date
chrono::DateTime::from_timestamp(1793622375, 0) // Option<DateTime<Utc>> Date to timestamp
NaiveDate::from_ymd_opt(2026, 11, 2).unwrap().and_hms_opt(12, 26, 15).unwrap().and_utc().timestamp() The standard library has no calendar; the date examples use the chrono crate.
Current Unix time
time() Timestamp to date
gmdate('Y-m-d\TH:i:s\Z', 1793622375) Date to timestamp
gmmktime(12, 26, 15, 11, 2, 2026) date() and mktime() use the default time zone; the gm* versions use UTC.
Current Unix time
Time.now.to_i Timestamp to date
Time.at(1793622375).utc Date to timestamp
Time.utc(2026, 11, 2, 12, 26, 15).to_i Current Unix time
Int(Date().timeIntervalSince1970) Timestamp to date
Date(timeIntervalSince1970: 1793622375) Date to timestamp
Int(ISO8601DateFormatter().date(from: "2026-11-02T12:26:15Z")!.timeIntervalSince1970) Current Unix time
time_t now = time(NULL); Timestamp to date
time_t t = 1793622375;
struct tm *utc = gmtime(&t); Date to timestamp
struct tm tm = { .tm_year = 2026 - 1900, .tm_mon = 10, .tm_mday = 2, .tm_hour = 12, .tm_min = 26, .tm_sec = 15 };
time_t t = timegm(&tm); /* glibc, BSD, macOS */ mktime() would read the struct as local time.
Current Unix time
date +%s Timestamp to date
date -u -d @1793622375 Date to timestamp
date -u -d '2026-11-02 12:26:15' +%s macOS/BSD: date -u -r 1793622375 to read a timestamp.
Current Unix time
[DateTimeOffset]::UtcNow.ToUnixTimeSeconds() Timestamp to date
[DateTimeOffset]::FromUnixTimeSeconds(1793622375).UtcDateTime Date to timestamp
[DateTimeOffset]::Parse('2026-11-02T12:26:15Z').ToUnixTimeSeconds() Current Unix time
SELECT floor(extract(epoch FROM now()))::bigint; Timestamp to date
SELECT to_timestamp(1793622375); Date to timestamp
SELECT extract(epoch FROM timestamptz '2026-11-02 12:26:15+00')::bigint; extract(epoch …) has a fractional part; a plain ::bigint cast rounds it.
Current Unix time
SELECT UNIX_TIMESTAMP(); Timestamp to date
SELECT FROM_UNIXTIME(1793622375); Date to timestamp
SELECT UNIX_TIMESTAMP('2026-11-02 12:26:15'); Both functions use the session time zone; run SET time_zone = '+00:00' first to work in UTC.
Current Unix time
SELECT unixepoch(); Timestamp to date
SELECT datetime(1793622375, 'unixepoch'); Date to timestamp
SELECT unixepoch('2026-11-02 12:26:15'); unixepoch() needs SQLite 3.38 or later; older versions use strftime('%s', …).
Current Unix time
SELECT DATEDIFF_BIG(SECOND, '1970-01-01', SYSUTCDATETIME()); Timestamp to date
SELECT DATEADD(SECOND, 1793622375, '1970-01-01'); Date to timestamp
SELECT DATEDIFF_BIG(SECOND, '1970-01-01', '2026-11-02 12:26:15'); DATEADD takes an int, so timestamps after 2038-01-19 must be added in two steps.
Current Unix time
=(NOW()-DATE(1970,1,1))*86400 Timestamp to date
=1793622375/86400+DATE(1970,1,1) Date to timestamp
=(DATE(2026,11,2)+TIME(12,26,15)-DATE(1970,1,1))*86400 NOW() is local time, so the first formula is off by your UTC offset; format the second as a date.
What Unix time counts, exactly
POSIX defines the epoch as “zero hours, zero minutes, zero seconds, on January 1, 1970 Coordinated Universal Time” and counts every day as exactly 86,400 seconds. A Unix timestamp is therefore a calendar calculation, not a stopwatch: take the UTC date and time, count the days since 1970 times 86,400, and add the seconds of the day.
That has three consequences worth knowing:
- Leap seconds are not counted. UTC has had 27 leap seconds, the first at the end of June 30, 1972 and the last at the end of December 31, 2016. Unix time ignores all of them, so it is not the number of SI seconds since 1970 (POSIX itself says only that it “approximates” them). Since January 1, 2017, TAI − UTC has been 37 seconds. The IERS announced no leap second for the end of December 2026 (Bulletin C 72), and in October 2026 the CGPM decided that UTC will become continuous, with no further leap seconds, from May 20, 2027 (Resolution 5, 2026).
- There is no time zone. The same instant has the same timestamp in Tokyo and New York. Zones appear only when you format the number as a date.
- Negative values are dates before 1970 by common practice, although POSIX leaves them undefined.
Seconds, milliseconds, microseconds, nanoseconds
Unix time is defined in seconds, but many systems store finer units: JavaScript’s Date.now() and Java’s System.currentTimeMillis() give milliseconds, PostgreSQL stores microseconds, Go’s UnixNano() nanoseconds. Mixing them up is the most common timestamp bug: a millisecond value read as seconds lands tens of thousands of years in the future, and a seconds value read as milliseconds lands in January 1970. The digit count tells you which you have: 10 digits for seconds, 13 for milliseconds, 16 for microseconds and 19 for nanoseconds, for any date between 2001 and 2286.
The year 2038 problem
A signed 32-bit integer holds at most 2,147,483,647. As a Unix timestamp that is 2038-01-19T03:14:07Z. One second later, a 32-bit counter wraps to -2,147,483,648, which reads as 1901-12-13T20:45:52Z. Unsigned 32-bit values last until 2106-02-07T06:28:15Z. The POSIX rationale for time() says it plainly: a 32-bit signed integer “fails in the year 2038”, and the preferred solution is a wider time_t. The current standard (Issue 8, 2024) requires time_t to be at least 64 bits. The risk is in old embedded systems, file formats and database columns that still store 32 bits (SQL Server’s DATEADD, for example, takes an int).
Other counts that start somewhere else
Much software counts from another zero. Choose the format in the converter’s Unit list to read one, and any timestamp you convert shows all of these.
| Format | Counts | From | From Unix seconds |
|---|---|---|---|
| .NET DateTime.Ticks | 100 ns | January 1, 0001 | (s + 62135596800) × 10,000,000 |
| Windows FILETIME, Active Directory | 100 ns | January 1, 1601 UTC | (s + 11644473600) × 10,000,000 |
| Excel serial date | days | serial 1 is January 1, 1900 | s ÷ 86,400 + 25569 |
| Discord snowflake | ms, top bits | the first second of 2015 | (ms − 1420070400000) × 222 |
Microsoft notes that DateTime ticks leave out leap seconds, like Unix time. Excel’s 25569 includes a day that never existed: Microsoft documents that Excel wrongly treats 1900 as a leap year, kept for compatibility with Lotus 1-2-3, so serials before March 1, 1900 are one too high. To show a timestamp in each reader’s own zone in a Discord message, send <t:1793622375:F>; Discord’s docs define the styles.
Milestones
| Timestamp | UTC |
|---|---|
| 1,000,000,000 | 2001-09-09T01:46:40Z |
| 1,500,000,000 | 2017-07-14T02:40:00Z |
| 1,700,000,000 | 2023-11-14T22:13:20Z |
| 1,800,000,000 | 2027-01-15T08:00:00Z |
| 2,000,000,000 | 2033-05-18T03:33:20Z |
| 2,147,483,647 | 2038-01-19T03:14:07Z (signed 32-bit limit) |
| 3,000,000,000 | 2065-01-24T05:20:00Z |
| 4,294,967,295 | 2106-02-07T06:28:15Z (unsigned 32-bit limit) |
Unix time at the start of each year
| January 1, 00:00:00 UTC | Seconds | Milliseconds |
|---|---|---|
| 2024 | 1704067200 | 1704067200000 |
| 2025 | 1735689600 | 1735689600000 |
| 2026 | 1767225600 | 1767225600000 |
| 2027 | 1798761600 | 1798761600000 |
| 2028 | 1830297600 | 1830297600000 |
| 2029 | 1861920000 | 1861920000000 |
| 2030 | 1893456000 | 1893456000000 |
A year is 31,536,000 seconds, or 31,622,400 in a leap year, so these differences are exact. The Julian Day also converts with a fixed offset: Unix time = (JD − 2440587.5) × 86,400.