Unix Time Converter
Convert Unix timestamps to human-readable dates and convert dates back to Unix time.
What Is a Unix Timestamp?
A Unix timestamp is a system for tracking time as a single integer — the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC (the Unix epoch). This format is widely used in programming, databases, APIs, and system logs because it is timezone-independent and easy to compute with.
For example, the timestamp 1700000000 represents a specific moment in time, regardless of where you are in the world. Converting between Unix timestamps and human-readable dates is a common task for developers, system administrators, and data analysts.
How the Unix Time Converter Works
This tool performs two conversions:
- Unix timestamp to date: Enter a Unix timestamp (e.g., 1700000000) and the tool converts it to a standard date and time format in your local timezone.
- Date to Unix timestamp: Enter a date and time, and the tool calculates the corresponding Unix timestamp.
The conversion uses the standard Unix epoch formula: timestamp = (date - January 1, 1970) in seconds. The tool automatically accounts for your system's timezone offset, so the displayed date matches your local time.
How to Use the Converter
- Convert timestamp to date: Paste or type a Unix timestamp into the input field. The corresponding human-readable date and time will appear instantly.
- Convert date to timestamp: Enter a date and time using the provided date picker or text input. The tool will display the equivalent Unix timestamp.
- Copy the result: Use the copy button to quickly grab the converted value for use in your code, database, or documentation.
Example Conversions
| Unix Timestamp | Human-Readable Date (UTC) |
|---|---|
| 0 | January 1, 1970, 00:00:00 |
| 1000000000 | September 9, 2001, 01:46:40 |
| 1700000000 | November 14, 2023, 22:13:20 |
| 2000000000 | May 18, 2033, 03:33:20 |
Understanding the Results
The converted date is displayed in your local timezone by default. If you need UTC time, the tool also shows the UTC equivalent. This is important because the same Unix timestamp represents a different local time depending on where you are in the world.
For example, timestamp 1700000000 is:
- November 14, 2023, 22:13:20 UTC
- November 14, 2023, 17:13:20 EST (UTC-5)
- November 15, 2023, 03:43:20 IST (UTC+5:30)
When working with timestamps in code, always verify whether your system expects seconds or milliseconds. This tool uses seconds, which is the standard Unix convention.
Common Mistakes When Working with Unix Timestamps
- Confusing seconds and milliseconds: JavaScript's
Date.now()returns milliseconds, not seconds. Divide by 1000 to get a Unix timestamp. - Ignoring timezone: A Unix timestamp is always UTC. Converting it to local time without accounting for the offset leads to incorrect dates.
- Using the wrong epoch: Some systems use January 1, 2001, or other epochs. Always confirm the epoch your system uses.
- Negative timestamps: Timestamps before 1970 are negative numbers. Not all systems handle them correctly.
Practical Use Cases
- Debugging logs: System logs often store timestamps as Unix time. Convert them to read when an event occurred.
- Database queries: Convert human-readable dates to timestamps for filtering records by date range.
- API development: Many APIs return timestamps in Unix format. Convert them for display in user interfaces.
- Data migration: When moving data between systems, timestamps may need conversion to ensure consistency.
- Scheduling tasks: Calculate future timestamps for cron jobs, reminders, or expiration dates.
Limitations
- This converter uses seconds, not milliseconds. If you have a millisecond value, divide by 1000 first.
- Dates before the Unix epoch (before 1970) are supported as negative timestamps, but some date pickers may not allow selection of dates before 1970.
- The tool relies on your browser's timezone settings. If your system time is incorrect, the converted date will also be incorrect.
FAQ
What is the Unix epoch?
The Unix epoch is January 1, 1970, at 00:00:00 UTC. It is the reference point from which all Unix timestamps are calculated.
Why do I see a different date than expected?
This is likely a timezone issue. The tool displays the date in your local timezone. Check the UTC equivalent to see the universal time.
How do I convert a millisecond timestamp?
Divide the millisecond value by 1000 to get a Unix timestamp in seconds, then use the converter. For example, 1700000000000 milliseconds becomes 1700000000 seconds.
Can I convert dates before 1970?
Yes. Dates before the Unix epoch produce negative timestamps. For example, December 31, 1969, 23:59:59 UTC is timestamp -1.
What happens with leap seconds?
Unix timestamps do not account for leap seconds. The system treats each day as exactly 86,400 seconds, which means leap seconds are effectively ignored.