JSFiddle - React, Tailwind, and code Playground

by whoamiwho

JavaScript

currentDate = "2012-01-30T16:23:12";
var date = new Date(currentDate);
alert(date);

//Rob Agar Suggestion to add "+00:00"
currentDate = "2012-01-30T16:23:12" + "+00:00";
alert(currentDate);
//Fix to get it into current time zone consistantly across browsers
var currentDate = new Date(currentDate);
currentDate = new Date((currentDate.getTime() + (currentDate.getTimezoneOffset() * 60 * 1000)));
alert(currentDate);