/**
* When using Ajax to pass time to the background (sometimes not in the background new date () can be resolved), this method to convert the local time format (Beijing) to the Date delivery background
*/
var datenow = new Date ();
Date = Format (Datenow, ' yyyy-mm-dd HH:mm:ss ');
/**
* These two functions are to get the international time of the foreground, which is easy to operate in the background
*/
var format = function (time, format) { //front desk acquisition times, converted to international time, can be used as tools
var t = new Date (time);
var tf = function (i) {return (I < 10?) ' 0 ': "") + i};
Return Format.replace (/yyyy| mm|dd| hh|mm|ss/g, function (a) {
Switch (a) {
Case ' yyyy ':
Return TF (T.getfullyear ());
Break
Case ' MM ':
Return TF (T.getmonth () + 1);
Break
Case ' mm ':
Return TF (T.getminutes ());
Break
Case ' DD ':
Return TF (T.getdate ());
Break
Case ' HH ':
Return TF (T.gethours ());
Break
Case ' SS ':
Return TF (T.getseconds ());
Break
}
})
}
Get the time in JavaScript and then upload to the background for action