function daysIntoYear(date){
    return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - Date.UTC(date.getFullYear(), 0, 0)) / 24 / 60 / 60 / 1000;
}
function secondsIntoDay(time) {
	let hour = time.getUTCHours();
	let minute = time.getUTCMinutes();
	let second = time.getUTCSeconds();
	return ((hour * 3600) + (minute * 60) + second)
}
let divText = document.getElementById("comments").innerHTML; 
newPageHTML=""; 
for (let comment = 0; comment < comments.length; comment++) { 
	if (typeof comments[comment][2] == 'undefined') {
		newPageHTML+=`<b>${comments[comment][0]}</b>: <i>${comments[comment][1]}</i><br/>`
	}
	else {
		let time = new Date(comments[comment][2])
		let second = Math.round((secondsIntoDay(time) / (86400/65536))).toString(16);
		let day = daysIntoYear(time).toString(16);
		let year = time.getUTCFullYear().toString(16);
		newPageHTML+=`[${second} ${day}/${year}] <b>${comments[comment][0]}</b>: <i>${comments[comment][1]}</i><br/>`
	}
}; 
document.getElementById("comments").innerHTML = newPageHTML
