// Yyyy-mm-dd
Function changedateformat (time ){
If (time! = NULL ){
VaR date = new date (parseint (time. Replace ("/date (", ""). Replace (")/", ""), 10 ));
VaR month = date. getmonth () + 1 <10? "0" + (date. getmonth () + 1): Date. getmonth () + 1;
VaR currentdate = date. getdate () <10? "0" + date. getdate (): Date. getdate ();
Return date. getfullyear () + "-" + month + "-" + currentdate;
}
Return "";
}
// Yyyy-mm-dd-hh-mm-SS
// Convert/date (...)/to yyyy-mm-dd function changedateformats (time) {If (time! = NULL) {var date = new date (parseint (time. replace ("/date (",""). replace (")/", ""), 10);/* var month = date. getmonth () + 1 <10? "0" + (date. getmonth () + 1): Date. getmonth () + 1; var currentdate = date. getdate () <10? "0" + date. getdate (): Date. getdate (); return date. getfullyear () + "-" + month + "-" + currentdate; */var now = new date (). format ("yyyy-mm-dd hh: mm: SS", date); return now;} return "";}
// Convert the date format to date. prototype. format = function (format, date) {/** eg: format = "yyyy-mm-dd hh: mm: SS"; */var o = {"m + ": date. getmonth () + 1, // month "d +": Date. getdate (), // Day "H +": Date. gethours (), // Hour "m +": Date. getminutes (), // minute "s +": Date. getseconds (), // second "q +": math. floor (date. getmonth () + 3)/3), // quarter "S": Date. getmilliseconds () // millisecond}
If (/(Y + )/. test (Format) {format = format. replace (Regexp. $1, (date. getfullyear () + ""). substr (4-Regexp. $1. length ));}
For (var k in O) {If (New Regexp ("(" + K + ")"). test (Format) {format = format. replace (Regexp. $1, Regexp. $1. length = 1? O [k]: ("00" + O [k]). substr ("" + O [k]). Length) ;}} return format ;}