What Is a Unix Timestamp?
A Unix timestamp, also called epoch time or POSIX time, is the number of seconds that have passed since 1 January 1970 at 00:00:00 UTC. That moment is called the Unix epoch. Because it is just one number with no time zone, servers, databases, APIs and analytics tools use it everywhere to store dates.
The catch is that people cannot read it, and different systems use different units. PHP and most server logs count seconds, JavaScript counts milliseconds, and the Google Analytics export to BigQuery stores event_timestamp in microseconds. This converter detects the unit from the number of digits, shows the date in UTC and your chosen time zone, and runs entirely in your browser.
How to Use the Unix Timestamp Converter
- Paste a timestamp into Timestamp to Date. The unit is detected for you, or you can set it by hand.
- Pick a time zone, such as India (IST) or New York. You see the date in UTC and in that zone, plus ISO 8601, the HTTP date format and how long ago it was.
- Go the other way with Date to Timestamp. Choose a date, a time and the zone it belongs to, then copy the seconds or milliseconds.
- Convert a whole log by pasting lines into Convert Many Timestamps. The first timestamp on each line is converted, and you can download the result as a CSV.
How Many Digits? Seconds, Milliseconds and More
| Digits today | Unit | Where you see it |
|---|---|---|
| 10 | Seconds | PHP time(), Unix and server logs, JWT exp and iat claims, most APIs |
| 13 | Milliseconds | JavaScript Date.now(), Java, many tracking and ad platform exports |
| 16 | Microseconds | GA4 BigQuery event_timestamp, some database and Python tools |
| 19 | Nanoseconds | Go UnixNano(), InfluxDB and other monitoring tools |
JavaScript dates work in milliseconds, as explained in the MDN Date reference, while the GA4 BigQuery export schema lists event times in microseconds, UTC.
Get the Current Timestamp in Code
| Language or tool | Code |
|---|---|
| JavaScript | Math.floor(Date.now() / 1000) |
| Python | int(time.time()) |
| PHP | time() |
| MySQL | SELECT UNIX_TIMESTAMP(); |
| Linux or Mac terminal | date +%s |
| Excel or Google Sheets | =A1/86400+DATE(1970,1,1) turns seconds in A1 into a date |
Practical Tips
- Store UTC, show local. Keep timestamps in UTC in your database and only convert to IST or another zone when you display them.
- A date in 1970 means the wrong unit. If seconds are read as milliseconds you land in January 1970, and the reverse gives a year far in the future.
- Watch out for 2038. Systems that store time as a signed 32 bit number stop at 19 January 2038, 03:14:07 UTC. The tool warns you when a date is past that point.
- Check AI written code. AI assistants often mix up seconds and milliseconds. Paste the value your code produces here to confirm it is the date you expect.
Work With Time in Your Projects
Scheduling scripts? Read how to set up PHP cron jobs, then learn to read crawl times in Python log file analysis for Googlebot and keep errors traceable with PHP error logging and monitoring. Checking when a login token expires? Paste it into the Base64 and JWT decoder.
Frequently Asked Questions
1What is a Unix timestamp?
It is the number of seconds since 1 January 1970 at 00:00:00 UTC, called the Unix epoch. It has no time zone, so the same timestamp means the same moment everywhere. Some systems count milliseconds or microseconds instead of seconds.
2How do I convert a Unix timestamp to a date in Excel or Google Sheets?
Use =A1/86400+DATE(1970,1,1) and format the cell as a date and time. The result is in UTC. For India time add 5.5/24, and if the timestamp is in milliseconds divide by 86400000 instead of 86400.
3Why does my timestamp show a date in 1970 or thousands of years from now?
The unit is wrong. A millisecond value read as seconds lands far in the future, and a seconds value read as milliseconds lands in January 1970. Count the digits: 10 is seconds, 13 is milliseconds and 16 is microseconds.
4What is the Year 2038 problem?
Systems that store Unix time as a signed 32 bit integer can only count up to 2147483647, which is 19 January 2038 at 03:14:07 UTC. After that the number overflows. Modern systems use 64 bit time, which lasts for billions of years.