We generally encounter the problem of displaying time in projects. The general way to deal with it is to control it through JS at the front desk. The code for JS to control the display time is as follows, with various display methods:
function Clock() {
var date = new Date();
this.year = date.getFullYear();
this.month = date.getMonth() 1;
this.date = date.getDate();
this.day = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")[date.getDay()];
this.hour = date. getHours() < 10 ? "0" date.getHours() : date.getHours();
this.minute = date.getMinutes() < 10 ? "0" date.getMinutes() : date.getMinutes ();
this.second = date.getSeconds() < 10 ? "0" date.getSeconds() : date.getSeconds();
this.toString = function() {
return "Now is:" this.year "Year" this.month "Month" this.date "Day" this.hour ":" this.minute ":" this.second " " this.day;
};//Now is Now is: Wednesday, March 6, 2013 13:54:17