JSFiddle - React, Tailwind, and code Playground

by ucdl

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());

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);