How it is worked out
The date and time are read in the time zone you pick, turned into an instant, and counted in seconds from 00:00:00 UTC on 1 January 1970.
The time zone matters: 09:00 on 1 March 2027 in Berlin (UTC+1) is 1803888000, the same clock time in UTC is 1803891600, an hour later. Pick UTC when the time came from a server or a log, your own zone when it is a time you live by.
On the night summer time ends, one hour happens twice; the converter takes the first. On the night it starts, one hour does not exist, and the time is moved past the gap.
In code
JavaScript: Math.floor(new Date('2027-03-01T09:00:00Z').getTime() / 1000).
Python: int(datetime(2027, 3, 1, 9, tzinfo=timezone.utc).timestamp()).
PostgreSQL: EXTRACT(EPOCH FROM TIMESTAMPTZ '2027-03-01 09:00:00+00').
Shell (GNU): date -d '2027-03-01 09:00 UTC' +%s.
To add time to a timestamp, add seconds: one day is 86,400. Use a date library for months, since they differ in length.
Seconds in common units
| Unit | Seconds | Milliseconds |
|---|---|---|
| Minute | 60 | 60,000 |
| Hour | 3,600 | 3,600,000 |
| Day | 86,400 | 86,400,000 |
| Week | 604,800 | 604,800,000 |
| Month (average) | 2,629,746 | 2,629,746,000 |
| Year (average) | 31,556,952 | 31,556,952,000 |
| Decade (average) | 315,569,520 | 315,569,520,000 |
A month is an average Gregorian month (30.44 days), a year an average Gregorian year (365.2425 days).
Worked example: a token that expires in an hour
A login token is issued at 09:00 UTC on 1 March 2027, Unix time 1803891600. It should expire an hour later, so its exp field is 1803891600 + 3600 = 1803895200; a day later would be + 86400 = 1803978000.
JSON Web Tokens and most APIs count in seconds; JavaScript’s Date and Java count in milliseconds, three digits longer: 1803891600000. A timestamp with 13 digits is in milliseconds.
Old systems that store Unix time in a signed 32-bit number run out at 2147483647, 03:14:07 UTC on 19 January 2038, and wrap round to 1901.
Unix time at the start of each month of 2027
| 00:00 UTC on | Seconds | Milliseconds |
|---|---|---|
| January 1, 2027 | 1798761600 | 1798761600000 |
| February 1, 2027 | 1801440000 | 1801440000000 |
| March 1, 2027 | 1803859200 | 1803859200000 |
| April 1, 2027 | 1806537600 | 1806537600000 |
| May 1, 2027 | 1809129600 | 1809129600000 |
| June 1, 2027 | 1811808000 | 1811808000000 |
| July 1, 2027 | 1814400000 | 1814400000000 |
| August 1, 2027 | 1817078400 | 1817078400000 |
| September 1, 2027 | 1819756800 | 1819756800000 |
| October 1, 2027 | 1822348800 | 1822348800000 |
| November 1, 2027 | 1825027200 | 1825027200000 |
| December 1, 2027 | 1827619200 | 1827619200000 |
Each day adds 86,400 seconds; Unix time ignores leap seconds.
Sources
IEEE Std 1003.1 (POSIX), Base Definitions, “Seconds Since the Epoch”.
RFC 7519, JSON Web Token: the NumericDate of the iat and exp claims, in seconds.
Written by the ufactory team and checked in November 2026.
Questions
Seconds or milliseconds?
Unix tools, PHP, Python and most databases use seconds. JavaScript and Java use milliseconds. The converter gives both.
What is the timestamp for midnight today?
Set the time to 00:00 and pick your time zone; midnight UTC is a different instant unless you live on UTC.
Which calculator do I need?
Seven calculators: days between two dates, add or subtract days, the countdowns to New Year, Thanksgiving and Black Friday, a Unix timestamp to a date and a date to a Unix timestamp. Each answers as you type, and the share bar links the calculation.