Date to timestamp converter

This calculator converts the date to epoch timestamp in milliseconds, that is, milliseconds since standard epoch of 1/1/1970, as used, for example, in JavaScript.

This page exists due to the efforts of the following people:

Timur

Timur

Michele

Michele

Created: 2017-09-07 03:44:20, Last updated: 2020-12-11 13:55:01
Creative Commons Attribution/Share-Alike License 3.0 (Unported)

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/7157/. Also, please do not modify any references to the original work (if any) contained in this content.

If somebody needs it, here is a calculator to convert human date to epoch timestamp in milliseconds, that is, milliseconds since standard epoch of 1/1/1970 as used, for example, in JavaScript Date object. I needed it to fill JSON data.

Calculator does the following:

output.SetValue(Date.UTC(
  input.getFullYear(), 
  input.getMonth(),
  input.getDate(),
  input.getHours(),
  input.getMinutes(),
  input.getSeconds()
));

As you can see, instead of a simple getTime call on Date object, which gives us milliseconds in UTC for local time (using browser's time zone), it creates UTC Date, which provides us with milliseconds in UTC for UTC time.

PLANETCALC, Date to timestamp converter

Date to timestamp converter

 
:
:
Timestamp in milliseconds
 

URL copied to clipboard
PLANETCALC, Date to timestamp converter

Comments