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:
- Timestamp → date:
date -d @1700000000— the@tellsdatethe number is an epoch timestamp. It prints the date in your local timezone. - Timestamp → date in UTC:
date -u -d @1700000000— same conversion, always in UTC, whatever your machine's timezone is. - Current time → timestamp:
date +%s— prints right now as whole seconds since the epoch. - Date → timestamp:
date -d "2023-11-14 22:13:20" +%s—dateparses the date (in your local timezone) and+%sprints the epoch value. Add-uto read the date as UTC. - 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:
| Unit | Digits today | Example (same moment) | Used by |
|---|---|---|---|
| Seconds | 10 | 1700000000 | Unix shells, PHP, Python int(time.time()), most databases, JWT claims |
| Milliseconds | 13 | 1700000000000 | JavaScript Date.now(), Java System.currentTimeMillis(), many REST APIs |
| Microseconds | 16 | 1700000000000000 | Python/Go timers, PostgreSQL internals, struct timeval, high-resolution logs |
| Nanoseconds | 19 | 1700000000000000000 | Go 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/time | What it is |
|---|---|---|
-2208988800 | 1900-01-01 00:00:00 | Pre-epoch; the NTP/1900 base era |
-1 | 1969-12-31 23:59:59 | One second before the epoch |
0 | 1970-01-01 00:00:00 | The Unix epoch itself |
86400 | 1970-01-02 00:00:00 | Exactly one day (86,400 s) later |
1000000000 | 2001-09-09 01:46:40 | The "one billion seconds" party |
1234567890 | 2009-02-13 23:31:30 | The famous 1234567890 moment |
1700000000 | 2023-11-14 22:13:20 | The worked example on this page |
2147483647 | 2038-01-19 03:14:07 | Signed 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
- Seconds/milliseconds mix-up. The single biggest source of "my date is in 1970" (or "in the year 55,000") bugs. Check the digit count: 10 today means seconds, 13 means milliseconds.
- Assuming a timestamp has a timezone. It does not — it is UTC. Apply the zone only when formatting for a human, and remember DST shifts the offset.
- Loose date strings.
07/08/2026is 7 August or 8 July depending on locale. Feed the parser an unambiguous ISO string (2026-07-08) to avoid a silent month/day swap. - Ignoring 32-bit limits. Scheduling anything past January 2038 through legacy 32-bit code will overflow into 1901.
- Forgetting JavaScript wants milliseconds.
new Date(1700000000)gives January 1970 — multiply by 1000 first.
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:
- llms.txt Generator & Validator — make a clean llms.txt file for your site in 2 minutes, and check any file against the basic rules.
- AI Crawler Checker — see whether GPTBot, ClaudeBot, PerplexityBot and 20 more AI crawlers can reach your site, or your robots.txt blocks them.
- Schema Markup Generator — make valid JSON-LD code for your pages, so search engines understand what each page is about.
- robots.txt Checker — check any site's robots.txt file: rules by bot, problems in plain words, a per-bot verdict table, and a tester for single pages.
- robots.txt Generator — build a robots.txt file in minutes: pick which AI bots may visit, add your sitemap, and download the file.
- AI Crawler Diagnostic Tool — diagnose your site for AI crawlers: find what blocks them and get the exact fix for each problem.
- AI Crawler Monitoring — keep watch after the check: spot AI bot visits in your server logs, Cloudflare analytics, and GA4.
- AI Agent Directory — the full list of 23 AI crawlers: who runs each one, what it does, and how to check a real visit.
- Secure Password Generator — generate a secure password or a word-based passphrase in one click. Made in your browser, never stored or sent anywhere.
- QR Code Generator — make a free QR code that never expires, for a link, text, Wi-Fi, email or phone. No account, no tracking, nothing uploaded.
- Password Strength Checker — check a password you already have: entropy, crack time, and pattern warnings, all in your browser.
- API Key Generator — make random API keys, secrets, and JWT signing secrets for your apps. Made in your browser, never stored or sent anywhere.
- QR Code Reader — scan a QR code from an image or your camera and see what it holds, with a warning for risky links. Nothing uploaded.
- UUID Generator — make UUIDs in one click — v4, v7, v1, v6, or name-based v3/v5. Bulk up to 1,000. Made in your browser, never stored or sent anywhere.
- Lorem Ipsum Generator — generate lorem ipsum in one click — paragraphs, sentences, words, characters or lists, as plain text, HTML, Markdown or JSON. Made in your browser, never stored or sent anywhere.
- Timestamp Converter — convert a Linux timestamp to a date and back — seconds, milliseconds, microseconds or nanoseconds, in any timezone, with copyable date commands. Made in your browser, never stored or sent anywhere.
- DNS Leak Check — check for DNS leaks: WebRTC test, visible IP + ISP + ASN, IPv6 exposure, encrypted-DNS reachability, and a DNS resolver identifier. Honest about its limits, no VPN ad.
- Tip Calculator — calculate a tip, the total and each person's share — bill, tip %, split, round-up, service presets and a comparison table. Free, no sign-up, nothing stored.
- Case Converter — convert text to lower case, Title Case, UPPER CASE, Sentence case and 11 more — camelCase, snake_case, kebab-case and more. Free, in your browser, nothing stored.
- URL Encoder & Decoder — encode and decode URLs — component, full URL, form and strict RFC 3986 modes, per-character breakdown and a query-string builder. Free, in your browser, nothing stored.
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.