Copy Code code as follows:
/**
* Date of format
* @param {Object} MS represents the number of milliseconds between the specified date and the global standard Time between midnight and January 1, 1970
* @return Year-month-date hh:mm
*/
Util.parsetodate = function (ms) {
var date = (new Date (parseint (MS));
return FormatDate (date, "Yyyy-mm-dd mm:hh");
};
/**
* Date of format
* <code>
* YYYY-------Years
* MM---------Month
* DD---------Day
* When HH---------
* mm---------Points
* such as: Util.formatdate (New Date (), ' yyyy-mm-dd mm:hh ');
* or Util.formatedate (new Date (), ' yyyy/mm/dd mm/hh ');
* </code> * @param {date}date Date objects that need to be formatted
* @param {Object} style style
* @return Returns the current time formatted
*/
Util.formatdate = function (date, style) {
var y = date.getfullyear ();
var M = "0" + (date.getmonth () + 1);
M = m.substring (m.length-2);
var d = "0" + date.getdate ();
D = d.substring (d.length-2);
var h = "0" + date.gethours ();
h = h.substring (h.length-2);
var m = "0" + date.getminutes ();
m = m.substring (m.length-2);
return style.replace (' yyyy ', y). Replace (' mm ', m). Replace (' DD ', D). Replace (' hh ', h). replace (' mm ', m);
}