類錯誤我輸入以下代碼在JS
var curdte=new Date();
var curdteyr=curdte.getYear();
var curdtemh=curdte.getMonth();
var curdtedy=curdte.getDay();
var dtecurr=(curdtedy "-" curdtemh "-" curdteyr);
var fyear1=fromdat1.substring(6,10,10);
var fmonth1=fromdat1.substring(3,5,10);
var fday1=fromdat1.substring(0,2,10);
var fmdiff=(fday1 "-" fmonth1 "-" fyear1);
var frmdate1=(fyear1 "-" fmonth1 "-" fday1);
var tyear1=todat1.substring(6,10,10);
var tmonth1=todat1.substring(3,5,10);
var tday1=todat1.substring(0,2,10);
var todiff=(tday1 "-" tmonth1 "-" tyear1);
var todate3=(tyear1 "-" tmonth1 "-" tday1);
var oneday=24*60*60*1000;
var frmdiff=new Date(Math.ceil(dtecurr.getTime()-fmdiff.getTime())/oneday);
然後我得到的錯誤:
TypeError: dtecurr.getTime is not a function
我很奇怪,爲什麼你不給'的SyntaxError
,然後設置值:意外string' .... – 0xc0de