new date mathod js code example
Example 1: updatable time js
function timeClock()
{
setTimeout("timeClock()", 1000);
now = new Date();
alert(now);
f_date = now.getDate()+" "+strMonth(now.getMonth())+" "+now.getFullYear()+" / "+timeFormat(now.getHours(), now.getMinutes());
return f_date;
}
<span class="foo"><script type="text/javascript">document.write(timeClock());</script></span>
Example 2: new date javascript
/*Get date from JS API - Date() class*/
let local_date = new Date();
alert("it is " + local_date + "!")