JSFiddle - React, Tailwind, and code Playground
HTML
<input id="foo" name="foo" type="text" value="" size="55" />
JavaScript
jQuery(document).ready(function() {
var foo = jQuery('#foo');
function updateTime() {
var now = new Date();
var date = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + ' ' + now.getHours() + ':' + now.getMinutes();
foo.val(date);
}
updateTime();
setInterval(updateTime, 5000); // 5 * 1000 miliseconds
});