Home >Web Front-end >JS Tutorial >A small example of JS controlling date display_javascript skills
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:
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