1. Timestamp conversion
1 //timestamp (available with date and no Date) converted to date "May 30, 2016 10:29:30 2016-05-20 09:11"2 functiontimeconversion (timestamp,type) {3 if(timeStamp) {4 if(timestamp.indexof (' Date ') >-1) {5 varDtime = timestamp.substring (6, timestamp.length-2);6 varNewdate =NewDate ();7 newdate.settime (dtime);8 varYear =newdate.getfullyear ();9 varMonth = Newdate.getmonth () + 1;Ten vardata =newdate.getdate (); one varhour = ' 0 ' +newdate.gethours (); ahour = hour.substring (hour.length-2) - varminute = ' 0 ' +newdate.getminutes (); -minute = minute.substring (minute.length-2) the varSecond = ' 0 ' +newdate.getseconds (); -Second = second.substring (second.length-2) - vars = ""; - if(type && Type = = 1) { +s = year + "-" + month + "-" + data + "" + hour + ":" +minute; - } + Else { as = year + "years" + month + "month" + data + "day" + hour + ":" + minute + ":" +second; at } - - returns; - } - Else { - varDT = Timestamp.split (' '); in vars =dt; - if(dt.length > 1) { to varDate = Dt[0].split ('/')); + varTime = Dt[1].split (': ')); - varhour = ' 0 ' + time[0]; thehour = hour.substring (hour.length-2); * if(type && Type = = 1) { $s = date[0] + "-" + date[1] + "-" + date[2 "+" "+ hour +": "+ time[1];Panax Notoginseng } - Else { thes = date[0] + "year" + date[1] + "month" + date[2] + "day" + hour + ":" + time[1] + ":" + time[2]; + } a } the returns; + } - } $}
JS Common methods