function Getcurrent date () {
Get system time
var lstr_ndate=new Date ();
var lstr_year=lstr_ndate.getfullyear ();
var lstr_month=lstr_ndate.getmonth ();
var lstr_date=lstr_ndate.getdate ();
Processing
var uom = new Date (lstr_year,lstr_month,lstr_date);
Uom.setdate (Uom.getdate ());//Get system time the day before, focus here, negative number is a few days ago, positive number is after a few days
var lint_mm=uom.getmonth ();
lint_mm++;
var lstr_mm=lint_mm > 10? LINT_MM: ("0" +lint_mm)
var lint_dd=uom.getdate ();
var lstr_dd=lint_dd > 10? LINT_DD: ("0" +LINT_DD)
Get the final result
UoM = uom.getfullyear () + "-" + lstr_mm + "-" + lstr_dd;
return UOM;
}
Day before date function of the current date
function Getyesterday () {
Get system time
var lstr_ndate=new Date ();
var lstr_year=lstr_ndate.getfullyear ();
var lstr_month=lstr_ndate.getmonth ();
var lstr_date=lstr_ndate.getdate ();
Processing
var uom = new Date (lstr_year,lstr_month,lstr_date);
Uom.setdate (Uom.getdate ()-1);//Get system time the day before, focus here, negative number is a few days ago, positive number is after a few days
var lint_mm=uom.getmonth ();
lint_mm++;
var lstr_mm=lint_mm > 10? LINT_MM: ("0" +lint_mm)
var lint_dd=uom.getdate ();
var lstr_dd=lint_dd > 10? LINT_DD: ("0" +LINT_DD)
Get the final result
UoM = uom.getfullyear () + "-" + lstr_mm + "-" + lstr_dd;
return UOM;
}