Convert Date to Unix Timestamp
Convert a specific date and time into a Unix timestamp in seconds or milliseconds.
Your data is never sent to any server.
The date to Unix timestamp converter turns a specific day and time into its epoch value, in seconds and in milliseconds, alongside the ISO 8601 representation of the same instant. The date you type is read in your device’s time zone.
Seconds or milliseconds, depending on the system
The most common mistake when generating a timestamp is handing it over in the unit the receiver does not expect. Here is the convention in the usual environments:
| Environment | Unit | Example |
|---|---|---|
Unix, date +%s, PostgreSQL | seconds | 1700000000 |
JavaScript Date.now() | milliseconds | 1700000000000 |
JWT (exp, iat) | seconds | 1700000000 |
MongoDB, Java currentTimeMillis() | milliseconds | 1700000000000 |
Filtering by whole days
To get the records for one day, the safest query asks for those greater than or equal to 00:00:00 on that day and less than 00:00:00 on the next. With “up to 23:59:59” you lose the events of the last second if your system stores milliseconds. Generate both bounds here and paste them into your query.
How to use Date to Timestamp
- 1
Pick the date
Choose the day in the date field. It is read in your local time zone, exactly as your system would.
- 2
Set the time
Enter hours, minutes and seconds. Leave it blank and the start of the day is used.
- 3
Use "Now" for the current moment
The "Now" button fills in date and time with the present moment, handy for generating a timestamp on the fly.
- 4
Copy the value you need
You get the timestamp in seconds, in milliseconds and the date in ISO 8601, each with its own copy button.
Frequently asked questions
Which time zone is the date I enter read in?
Your device's. If you type 10:00, the timestamp is computed for 10:00 in your time zone. The ISO 8601 result lets you check which UTC instant that corresponds to.
What is the difference between the timestamp in seconds and in milliseconds?
Just a factor of 1000. Unix systems, PostgreSQL and most APIs use seconds; JavaScript, Java and MongoDB work in milliseconds. Both are shown here so you can copy whichever your system expects.
Which timestamp corresponds to the start of a day?
The one for 00:00:00 on that date, in your time zone. To filter a whole day, use it as the lower bound and 00:00:00 on the next day as the upper bound, excluding it.
Can I get the timestamp of a date before 1970?
Yes. Dates before the epoch produce a negative timestamp, which is perfectly valid and is returned as such.
Does daylight saving time affect the result?
Yes, because the date is read in your time zone. The same clock time yields a different timestamp in winter and in summer, since the offset from UTC changes.