Unix timestamp converter
Convert epoch timestamps to readable dates and dates to timestamps, in UTC or your own time zone.
Current Unix timestamp
–
Timestamp to date
Seconds, milliseconds, microseconds or nanoseconds
Date to timestamp
Code
Getting the current timestamp
| Language | Seconds since the epoch |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| PHP | time() |
| Go | time.Now().Unix() |
| Java | Instant.now().getEpochSecond() |
| Bash | date +%s |
| PostgreSQL | extract(epoch from now()) |
| MySQL | UNIX_TIMESTAMP() |
Timestamps and time zones
A timestamp marks one instant, the same everywhere. Time zones only matter when you turn it into a date and time for people to read: 1700000000 is 14 November 2023, 22:13:20 in UTC, but already 15 November in Tokyo. Store timestamps (or UTC times), and convert to local time only for display.
More tools
More on the bench
- JSON formatter and validatorPretty-print, minify and validate JSON, with the exact line of any error.
- Base64 encoder and decoderEncode text to Base64 and back, including URL-safe Base64 and emoji.
- URL encoder and decoderPercent-encode and decode URLs and query values, and break a URL into parts.
- Regex testerTest JavaScript regular expressions live, with groups and replace.
- Text diffCompare two texts or code snippets line by line or word by word.
- CSV to JSON converterConvert CSV to JSON and JSON to CSV, with delimiter detection.
- UUID generatorGenerate random v4 or time-ordered v7 UUIDs, one or a hundred at a time.
- JWT decoderRead the header and claims of a JSON Web Token, with expiry dates in plain English.
- Hash generatorSHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text.
- Lorem Ipsum generatorPlaceholder paragraphs, sentences or words, plain or as HTML.
Frequently asked questions
What is a Unix timestamp?
The number of seconds since 1 January 1970 at 00:00:00 UTC, a moment called the Unix epoch. It is the same everywhere in the world at a given instant, which makes it a simple, time-zone-free way for computers to store and compare times.
Is it in seconds or milliseconds?
Unix itself counts seconds, but JavaScript’s Date.now() and many Java and web APIs use milliseconds. A current timestamp in seconds has 10 digits; in milliseconds it has 13. This converter detects the unit from the number of digits.
What is the year 2038 problem?
Systems that store Unix time as a signed 32-bit number run out on 19 January 2038 at 03:14:07 UTC, when the count passes 2,147,483,647 and wraps around to a date in 1901. Modern systems use 64-bit numbers, which last for billions of years.
Does Unix time include leap seconds?
No. Unix time pretends every day has exactly 86,400 seconds, so the leap seconds added to UTC over the years are not counted. For everyday dates, this makes no visible difference.