Quote:
Originally Posted by dbirosel
So is this how it suppose to look?
Code:
var append = "AM";
var hour = date.getHours();
if(hour == 12) {
append = "PM";
}
if(hour > 12) {
hour = hour - 12;
append = "PM";
}
if(hour == 0) {
hour = 12;
append = "AM";
}
ret = ret + "[" +
hour + ":" +
((date.getMinutes() < 10) ? "0" : "") +
date.getMinutes() + ":" +
((date.getSeconds() < 10) ? "0" : "") +
date.getSeconds() + " " + append + "]";
|
Sure I think that'll work.