I am creating  a simple support ticket system. I thought It would be a nice little feature to show the current date and time. Since I want to show the current time I thought JavaScript would be best versus using PHP. I have looked at different questions posted by other user about the topic and created the following snippet. My question is if this is a efficient way to get and display the date and time using JavaScript date object. I also thought is would be appropriate to use the <time> tag. I also ask if I have used it in the correct form.JavaScript and HTMLvar monthName = new Array('January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');var hourap = new Array(12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);function showTime(){    var dateObj = new Date();    var day = dateObj.getDate(), month = dateObj.getMonth(), year = dateObj.getFullYear(), hour = dateObj.getHours(), minutes = (dateObj.getMinutes()<=9?'0'+dateObj.getMinutes():dateObj.getMinutes());    var string  = monthName[month]+    ' '+day+    ', '+year+    '<br />'+hourap[hour]+    ':'+minutes+    ' '+(hour<=11?'am':'pm');    var timeDiv = document.getElementById('time');    if(timeDiv !== null) {        timeDiv.innerHTML = string;        timeDiv.setAttribute('datetime',year+'-'+(month+1<=9?'0'+(month+1):month+1)+'-'+day+' '+hour+':'+minutes);    };};setInterval(showTime,1000);<time id=time></time>HTML output<time id=time datetime=2015-01-30 22:00>January 30, 2015<br>10:00 pm</time>Any suggestions or comments would be appreciated. Please note that I wish to script it using pure JavaScript and not jQuery.
Displaying current date and time using JavaScript and HTML time tag
javascript;datetime;html5