Unix Timestamp Converter
Convert a Unix timestamp to a readable date and a date back to a timestamp, in seconds or milliseconds, with the current epoch time always on screen.
Turn an epoch timestamp into a date you can read, or a date into the timestamp a system expects. Seconds and milliseconds are both handled, and a millisecond value is detected automatically so you do not have to think about which one you pasted.
1791378122// Unix Timestamp Converter: Features
Seconds or milliseconds, detected for you
Unix time counts from the first of January 1970 UTC, and different ecosystems count in different units. C, Go, PostgreSQL and most Unix tooling use seconds; JavaScript, Java and many APIs use milliseconds. Paste a value and the tool works out which you meant from its magnitude, because a millisecond timestamp for a current date has thirteen digits while a second timestamp has ten. Converting the other way gives you both figures so you can take whichever your target needs.
Why a date lands in 1970 or 54000
These are the two symptoms of a unit mismatch and they are worth recognising on sight. A millisecond value interpreted as seconds produces a date tens of thousands of years in the future. A second value interpreted as milliseconds produces a date a few days after the epoch, in January 1970. If a timestamp in your system renders as either, the fix is a factor of a thousand rather than anything subtler.
The timestamp itself has no time zone
This is the point that resolves most confusion. A Unix timestamp is a count of seconds since a fixed instant, so it identifies a moment in time unambiguously and carries no zone information at all. A time zone only enters when the number is rendered as a date. The tool shows both UTC and your local time so the difference is visible, and it is the reason two people can look at the same timestamp and read different wall-clock times without either being wrong.
The 2038 problem
A signed 32-bit integer counting seconds overflows on the nineteenth of January 2038, wrapping to a negative value that renders as 1901. Modern 64-bit systems are unaffected and will be for longer than the universe has existed, but 32-bit fields persist in embedded systems, older database columns and legacy protocols. If you are designing storage now, use 64 bits, and if you are auditing an old system, check the width of the column rather than assuming.
Comparing a moment across time zones
The conversion is arithmetic and date formatting performed in the page; nothing you enter is transmitted, stored or logged. To compare a moment across several cities rather than between epoch and local time, the Time Zone Converter applies the daylight saving rules in force on the date you choose.
// Unix Timestamp Converter: FAQ
What is a Unix timestamp?
- The number of seconds elapsed since midnight UTC on the first of January 1970, known as the epoch. It represents a single instant as one integer, which makes it easy to store, compare and do arithmetic on, and it is the basis for time handling in most systems.
How do I tell seconds from milliseconds?
- Count the digits. A current timestamp in seconds has ten digits; in milliseconds it has thirteen. This tool detects the difference automatically and tells you when it has read a value as milliseconds, so a pasted value from either kind of system converts correctly.
Why does my timestamp convert to a date in 1970?
- Because a value in seconds was interpreted as milliseconds, making it a thousand times smaller than intended and landing a few days after the epoch. The reverse mistake produces a date tens of thousands of years away. Both are unit mismatches rather than corrupt data.
Does a Unix timestamp include a time zone?
- No. It counts from a fixed instant in UTC, so the number identifies a moment unambiguously with no zone attached. The zone matters only when the number is formatted as a date, which is why the same timestamp displays as different wall-clock times in different places.
How do I convert in my own code?
- In JavaScript, multiply a seconds value by 1000 and pass it to the Date constructor, and divide getTime by 1000 to go back. Python has datetime.fromtimestamp and timestamp, taking seconds. In SQL the functions vary by database, with to_timestamp in PostgreSQL and FROM_UNIXTIME in MySQL. In every case, confirm the unit first.
What is the 2038 problem?
- A signed 32-bit seconds counter overflows on the nineteenth of January 2038 and wraps to a negative number, which renders as 1901. Sixty-four-bit systems are unaffected. It remains a live concern in embedded devices, older database schemas and legacy protocols that fixed the field at 32 bits.
Can a timestamp be negative?
- Yes, for dates before 1970, and support varies. Many systems handle negative timestamps correctly, and some do not, which is a common source of bugs in applications dealing with historical dates such as birthdates. If your data goes back before 1970, test that path explicitly.
What about leap seconds?
- Unix time ignores them by definition: every day is treated as exactly 86,400 seconds. When a leap second occurs, the timestamp is held or repeated rather than incremented, so the count stays aligned with the calendar. For almost all application purposes this is the behaviour you want, and it is why Unix time is not quite the same as elapsed physical time.
What format should I enter a date in?
- An ISO 8601 style value such as 2024-01-01T00:00:00 is the most reliable, because it is unambiguous about which number is the month. Other formats may work depending on your browser, but the ISO form removes the risk of a date being read the American way round.
Is the timestamp I enter sent to a server?
- No. The conversion runs in your browser and nothing you enter is transmitted, stored or logged.
// How to Use Unix Timestamp Converter
-
Pick a direction
Choose timestamp to date to read an epoch value, or date to timestamp to produce one. The current Unix time is displayed at the top throughout, ready to copy.
-
Enter your value
Paste a timestamp in seconds or milliseconds, or type a date in ISO 8601 form such as 2024-01-01T00:00:00. A millisecond value is detected automatically and the tool says so.
-
Read both renderings
Converting a timestamp shows it in UTC and in your local time, which is the quickest way to see whether a zone difference explains a discrepancy. Converting a date gives you both the seconds and milliseconds forms.
Category Utilities