Quote:
Originally Posted by dbirosel
Didn't see you answer this yet, but is it possible to change it from 24 hour to 12 hour instead? 
|
for 12 hour time with brackets:
replace
Code:
ret = ret + (date.getMonth()+1) + "/" +
date.getDate() + "/" +
date.getFullYear() + " " +
date.getHours() + ":" +
((date.getMinutes() < 10) ? "0" : "") +
date.getMinutes() + ":" +
((date.getSeconds() < 10) ? "0" : "") +
date.getSeconds() + " ";
with
Code:
var append = "AM";
var hour = date.getHours();
if(hour > 12) {
hour = hour - 12;
append = "PM";
}
if(hour == 0) {
hour = 12;
append = "AM";
}
ret = ret + "[" + (date.getMonth()+1) + "/" +
date.getDate() + "/" +
date.getFullYear() + " " +
hour + ":" +
((date.getMinutes() < 10) ? "0" : "") +
date.getMinutes() + " " +
((date.getSeconds() < 10) ? "0" : "") +
date.getSeconds() + " " + append + "]";