/** * Getnowformatdate get current time * @param msec millisecond value*/getnowformatdate:function(msecval) {if(msecval) {varnow =NewDate (Msecval);//millisecond value to full time}Else{ varnow =NewDate ();//Full Time }; varmonth = Now.getmonth () + 1;//Current Month varDay = Now.getdate ();//Current Day varHours = Now.gethours ();//Current Time varMinutes = Now.getminutes ();//Current points varSeconds = Now.getseconds ();//Current seconds if(Month >= 1 && month <= 9) {//Monthmonth = "0" +month; }; if(Day >= 0 && Day <= 9) {//DayDay = "0" +Day ; }; if(Hours >= 0 && Hours <= 9) {//whenHours = "0" +Hours; }; if(Minutes >= 0 && Minutes <= 9) {//pointsMinutes = "0" +Minutes; }; if(Seconds >= 0 && Seconds <= 9) {//secondsSeconds = "0" +Seconds; }; varcurrentdate = now.getfullyear () + "-" + month + "-" + Day + "+Hours+ ":" + Minutes + ":" +Seconds; returncurrentdate; },
JS Get current time