Get reference code
Appearance
Sample
LifeDate and Time

Date to timestamp converter

This calculator converts date to epoch timestamp in milliseconds, that is, milliseconds since standard epoch of 1/1/1970, as used, for example, in Javascript.
Timur2017-09-07 03:44:20

Just in case somebody need 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 simple getTime call on Date object, which gives us milliseconds in UTC for local time (using browser's timezone), it creates UTC Date, which gives us milliseconds in UTC for UTC time.

Date to timestamp converterCreative Commons Attribution/Share-Alike License 3.0 (Unported)
 :
 

Request a calculator
View all calculators
(514 calculators in total. )

Comments