JSFiddle - React, Tailwind, and code Playground
by chanaka1
JavaScript
var now = new Date();
var nowUTC = now.getTime() + now.getTimezoneOffset() * 60 * 1000;
var utc_timestamp = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(),
now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
document.write("Correct UTC timestamp " + now.getTime());
document.write("<br/>");
document.write("Incorect UTC timestamp " + utc_timestamp);
document.write("<br/>");
document.write("Incorect UTC timestamp " + nowUTC);