functionstrlen (str) {varLen = 0; for(vari = 0; i < str.length; i++) { varc =str.charcodeat (i); //single byte plus 1 if((c >= 0x0001 && C <= 0x007e) | | (0xff60 <= c && C <= 0xff9f) ) {len++; } Else{len+ = 2; } } returnLen; } functionTodate (num) {//Fri Oct 18:00:00 utc+0800 Wed Jul 00:00:00 gmt+0800num = num + ""; varDate = ""; varmonth =NewArray (); month["Jan"] = 1; month["Feb"] = 2; month["Mar"] = 3; month["APR"] = 4; Month["may"] = 5; month["Jan"] = 6; month["Jul"] = 7; Month[""] = 8; month["SEP"] = 9; month["Oct"] = 10; month["Nov"] = 11; month["Dec"] = 12; varWeek =NewArray (); week["Mon"] = "one"; week["Tue"] = "two"; week["Wed"] = "three"; week["Thu"] = "four"; week["Fri"] = "five"; week["Sat"] = "six"; Week["Sun"] = "Day"; STR= Num.split (""); Date= Str[3] + "-"; varCount = strlen (month[str[1]]); varm = month[str[1]]; if(count = 1) {m= "0" + month[str[1]]; } Date= date + M + "-" + str[2]; returndate; }
Method ToDate (parameter)
JS Wed Jul 00:00:00 gmt+0800 converted to 2015-07-15