var now = new Date(); now.setMinutes(now.getMinutes() - now.getTimezoneOffset()); document.getElementById('dt').value = now.toISOString().slice(0,16);
<input id="dt" type="datetime-local" /> Run code snippetHide results