How to convert a date to a Unix timestamp
Turn a human date into epoch seconds (or milliseconds) for APIs, JWTs, and databases. Free two-way converter plus the code one-liners.
Converting a date to a Unix timestamp gives you the single UTC number that APIs and databases prefer to store. Here is how to do it online and in code, including the seconds-vs-milliseconds choice.
Seconds or milliseconds
Decide which your target expects. Classic Unix time is seconds (10 digits); JavaScript’s Date.now() and many APIs use milliseconds (13 digits). Pick one and be consistent — mixing them is the most common timestamp bug.
In code
JavaScript: Math.floor(Date.now()/1000) for seconds, or new Date(str).getTime() for ms. Python: int(datetime.now(timezone.utc).timestamp()). Go: time.Now().Unix(). Always work in UTC to avoid timezone drift.
Step by step
Open the timestamp converter and enter your date (in UTC to avoid ambiguity).
Read the Unix timestamp it produces.
Choose seconds or milliseconds to match what your API/database expects.
In code, use Math.floor(Date.now()/1000) (JS) or datetime.timestamp() (Python).
Try it now — free, no signup
Use the timestamp converter in your browser. Then, when you need it at scale with an API key and higher limits, grab the full Eveses API.