Free Tools · by The Cited Brand
100% FREE · NO SIGN-UP · NOTHING LEAVES YOUR BROWSER

Timestamp Converter

Linux timestamp convert made simple: turn a Unix timestamp into a readable date — or a date back to epoch time — in seconds, milliseconds, microseconds or nanoseconds. Pick any timezone, copy the exact Linux date command for your value, or convert a C struct timeval. Everything runs in your browser: nothing is stored or sent anywhere.

Current Unix time

The live epoch clock — updating every second, in your browser.

Seconds since the epoch
—
Milliseconds
—

Timestamp → Date

Paste a Unix timestamp — seconds, milliseconds, microseconds or nanoseconds. The unit is detected from the digit count; force it below if the guess is wrong. Hex (0x…) and ISO date strings work too.

Try 1700000000 — the worked example used through this page.

Date → Timestamp

Pick a date and time, choose which timezone it belongs to, and get the epoch timestamp in all four units.

struct timeval converter

C's struct timeval stores a moment as two numbers: tv_sec (whole seconds since the epoch) and tv_usec (the leftover microseconds, 0–999999). Enter both to get the timestamp and the date — or convert any timestamp above to see its timeval breakdown.

Linux timestamp commands

The exact commands for the value you just converted — copy and paste them into any Linux terminal. They update every time you convert a new timestamp above.

On macOS, BSD date has no -d option: use date -r <epoch> to convert a timestamp to a date (for example date -r 1700000000). date +%s works the same on both.

Batch converter

Convert many timestamps at once — one per line. Mix seconds, milliseconds, microseconds, nanoseconds and ISO dates freely; each line is detected on its own. Output stays line-for-line with your input, so blank or bad lines are marked, never dropped.

What is a Unix timestamp?

A Unix timestamp — also called epoch time or POSIX time — is the number of seconds that have passed since the Unix epoch: midnight UTC on 1 January 1970. Leap seconds are not counted, so it is a plain integer that only ever grows. Because the count is anchored to UTC, one timestamp names the same instant everywhere on Earth — which is why databases, log files, JWT exp/iat claims and most APIs store it instead of a written-out date that would drag a timezone along.

A present-day value is around 1.8 billion — ten digits. You can sanity-check any epoch in your head: divide by 31,557,600 (seconds in an average year) and add 1970 to get the approximate year.

Linux timestamp convert, step by step

On Linux, the date command converts both ways. The converter above shows these commands with your own value filled in — here is what each one does:

  1. Timestamp → date: date -d @1700000000 — the @ tells date the number is an epoch timestamp. It prints the date in your local timezone.
  2. Timestamp → date in UTC: date -u -d @1700000000 — same conversion, always in UTC, whatever your machine's timezone is.
  3. Current time → timestamp: date +%s — prints right now as whole seconds since the epoch.
  4. Date → timestamp: date -d "2023-11-14 22:13:20" +%s — date parses the date (in your local timezone) and +%s prints the epoch value. Add -u to read the date as UTC.
  5. Exact output format: date -d @1700000000 "+%Y-%m-%d %H:%M:%S" — the format string controls every field, so scripts get exactly the shape they need.

Two details trip people up. First, date -d also understands natural words — date -d "tomorrow" +%s and date -d "next Friday" +%s both work. Second, macOS is different: BSD date has no -d option, so on a Mac you convert a timestamp with date -r 1700000000 instead. date +%s works identically on both.

Seconds, milliseconds, microseconds, nanoseconds

Different systems count the same moment in different units — the most common source of timestamp bugs. The table shows what each one looks like today:

UnitDigits todayExample (same moment)Used by
Seconds101700000000Unix shells, PHP, Python int(time.time()), most databases, JWT claims
Milliseconds131700000000000JavaScript Date.now(), Java System.currentTimeMillis(), many REST APIs
Microseconds161700000000000000Python/Go timers, PostgreSQL internals, struct timeval, high-resolution logs
Nanoseconds191700000000000000000Go time.Now().UnixNano(), tracing systems, date +%s%N

Get the unit wrong and the error is spectacular, not subtle: read a seconds value as milliseconds and you land 19 days after 1970; read a milliseconds value as seconds and you shoot to roughly the year 55,000. If a converted date lands in 1970 or tens of thousands of years in the future, you have almost certainly used the wrong unit — count the digits and force the right one with the buttons above.

struct timeval, explained

In C, struct timeval is how the operating system hands you a moment in time — from gettimeofday(), select() timeouts, and file timestamps. It has two fields:

struct timeval {
    time_t      tv_sec;   /* seconds since the epoch */
    suseconds_t tv_usec;  /* microseconds past tv_sec (0–999999) */
};

The full timestamp is tv_sec + tv_usec ÷ 1,000,000. So tv_sec = 1700000000, tv_usec = 500000 is 1700000000.5 seconds — 22:13:20.500 UTC on 14 November 2023. The microsecond part is always a fraction of one second, never a second count of its own. Its younger sibling, struct timespec, swaps tv_usec for tv_nsec (nanoseconds, 0–999999999) — the same idea, finer grain.

Common epoch landmarks

Handy reference points for spotting roughly when a raw value falls (all seconds, UTC):

Epoch (seconds)UTC date/timeWhat it is
-22089888001900-01-01 00:00:00Pre-epoch; the NTP/1900 base era
-11969-12-31 23:59:59One second before the epoch
01970-01-01 00:00:00The Unix epoch itself
864001970-01-02 00:00:00Exactly one day (86,400 s) later
10000000002001-09-09 01:46:40The "one billion seconds" party
12345678902009-02-13 23:31:30The famous 1234567890 moment
17000000002023-11-14 22:13:20The worked example on this page
21474836472038-01-19 03:14:07Signed 32-bit ceiling (Year 2038)

The Year 2038 problem

Software that stores Unix time in a signed 32-bit integer tops out at 2,147,483,647 seconds — 03:14:07 UTC on 19 January 2038. The next second overflows to a negative number and the date wraps back to December 1901. Anything modern uses 64-bit integers and is safe for about 292 billion years, but old embedded firmware, some binary file formats and legacy database columns still carry the ceiling. Before scheduling anything past 2038, check which one your data uses.

How to use this timestamp converter in code

Three one-liners for the languages developers reach for most. (The Linux shell versions are in the commands section above.)

# Python
import datetime
datetime.datetime.fromtimestamp(1700000000, tz=datetime.timezone.utc)
# → datetime.datetime(2023, 11, 14, 22, 13, 20, tzinfo=datetime.timezone.utc)

# JavaScript
new Date(1700000000 * 1000).toISOString()
// → "2023-11-14T22:13:20.000Z"   (note: Date takes MILLISECONDS — multiply by 1000)

// Go
time.Unix(1700000000, 0).UTC()
// → 2023-11-14 22:13:20 +0000 UTC

Common mistakes

Honest limits

JavaScript dates only resolve to the millisecond, so this page stores microseconds and nanoseconds exactly but displays them at millisecond precision plus the exact sub-millisecond fraction. Human-date parsing uses your browser's built-in Date engine: unambiguous ISO-8601 strings parse identically everywhere, but loose formats like 07/08/2026 differ across browsers and locales — prefer ISO for anything ambiguous. Local dates use your device's timezone database, so a machine with the wrong clock or an out-of-date zone database will show the wrong local time even though the epoch value is correct. Unix time ignores leap seconds: every day is exactly 86,400 seconds, so it is not a precise count of elapsed physical seconds.

More free tools

More free tools from The Cited Brand:

Frequently asked questions

How do I convert a Linux timestamp to a date?

In a Linux terminal, run date -d @1700000000 — the @ tells date the number is an epoch timestamp. It prints the date in your local timezone, for example Tue Nov 14 22:13:20 UTC 2023. Add -u for UTC (date -u -d @1700000000) or a format string for exact output: date -d @1700000000 "+%Y-%m-%d %H:%M:%S". This page does the same conversion in your browser and shows the commands with your own value filled in.

How do I get the current timestamp in Linux?

Run date +%s in the terminal — it prints the current Unix time in whole seconds, for example 1700000000. For milliseconds use date +%s%3N, for nanoseconds date +%s%N. On macOS the same date +%s works for the current time, but converting a timestamp back to a date is different: macOS uses date -r 1700000000 because BSD date has no -d option.

How do I convert a date to a timestamp in Linux?

Run date -d "2023-11-14 22:13:20" +%s — date parses the date and +%s prints it as an epoch timestamp (1700000000). The date is read in your local timezone; add -u to read it as UTC instead: date -u -d "2023-11-14 22:13:20" +%s. You can also use natural words: date -d "tomorrow" +%s or date -d "next Friday" +%s.

What is the difference between seconds, milliseconds, microseconds and nanoseconds?

They are the same moment measured in different units: 1 second = 1,000 milliseconds = 1,000,000 microseconds = 1,000,000,000 nanoseconds. A present-day timestamp has 10 digits in seconds (1700000000), 13 in milliseconds (1700000000000), 16 in microseconds and 19 in nanoseconds. Unix shells, PHP and most databases use seconds; JavaScript Date.now() and Java use milliseconds; Python and Go timers often use microseconds; tracing systems use nanoseconds. Mixing them up is the most common timestamp bug — a seconds value read as milliseconds lands in January 1970.

How do I convert struct timeval to a timestamp?

A struct timeval has two fields: tv_sec (whole seconds since the epoch) and tv_usec (the leftover microseconds, 0 to 999999). The timestamp is tv_sec + tv_usec / 1,000,000. For example, tv_sec = 1700000000 and tv_usec = 500000 is 1700000000.5 seconds — 22:13:20.500 UTC on 14 November 2023. The timeval converter on this page does it both ways: enter tv_sec and tv_usec to get the date, or convert any timestamp to see its timeval breakdown.

What is the Unix epoch?

The Unix epoch is 00:00:00 UTC on 1 January 1970. A Unix timestamp (also called epoch time or POSIX time) is the number of seconds since that moment, not counting leap seconds. Timestamp 0 is the epoch itself; 1700000000 is 22:13:20 UTC on 14 November 2023. Negative timestamps are dates before 1970: -1 is one second before the epoch.

What is the Year 2038 problem?

Software that stores Unix time in a signed 32-bit integer tops out at 2,147,483,647 seconds — 03:14:07 UTC on 19 January 2038. The next second overflows to a negative number and the date wraps back to December 1901. Modern 64-bit systems are safe for about 292 billion years, but old embedded firmware, some binary file formats and legacy database columns still carry the 32-bit ceiling, so it is worth knowing which your data uses before scheduling anything past 2038.

Why does the same timestamp show a different time in each timezone?

A Unix timestamp has no timezone of its own — it is a count of seconds since the epoch measured in UTC. A timezone only enters when you render that instant as a wall clock. The same timestamp is 22:13 in London (UTC) and 03:43 the next day in Karachi (UTC+5). Daylight saving adds another shift: New York is UTC-5 in winter but UTC-4 in summer, so the same zone can show two different offsets across the year. Store the epoch integer and convert to local time only when you display it.

Can a Unix timestamp be negative?

Yes. Times before the epoch are negative numbers: -1 is 23:59:59 UTC on 31 December 1969, and -86400 is midnight UTC on 31 December 1969. They are well defined, but portability is uneven — some databases and language runtimes reject or mishandle negative epoch values, so treat pre-1970 timestamps as a mild risk when data crosses systems. This converter handles them: force the Seconds reading if a large negative value is auto-detected as milliseconds.

Is this timestamp converter private?

Yes. Every conversion is computed in your browser with JavaScript — nothing you type is sent to our server, stored, or logged. The page works offline once it has loaded. If you close the page, your inputs are gone.