java時間函數應該注意的地方

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> daily progres report<script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/jscript/mootools-release-1.11.js"></script><link href="&lt;%=request.getContextPath()%&gt;/css/baseAll.css" rel="stylesheet" type="text/css"> <link href="&lt;%=request.getContextPath()%&gt;/css/base.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .STYLE1 { font-size: 36px; font-family: "Times New Roman", Times, serif; font-weight: bold; } .STYLE2 { font-weight: bold; font-family: "Times New Roman", Times, serif; color: #FF0000; } --> </style> <script type="text/javascript"> function myedit(oid) { var b=oid; var c=b.substring(9,b.length); var pid="1_"+c; //var aid="2_"+c; document.getElementById(pid).readOnly=false; //document.getElementById(aid).readOnly=false; //var docm=document.getElementById(editlist).value; //docm=docm+c+","; //alert(docm); //document.getElementById(edit1).value=docm; } function check1(oid) { var b=oid; var c=b.substring(2,b.length); var you="1_"+c; if(c==0) { var d=Math.round(c)+1; var behind="1_"+d; var a=document.getElementById(behind).value; var e=a.substring(0,a.length-1); var f=document.getElementById(you).value; alert('f='+f+'_a='+a); var g=f.substring(0,f.length-1); var h=Math.round(e); var i=Math.round(g); if(i>h) { document.getElementById("warning").value="錯誤位置﹕第2行﹐第"+d+"欄。"+"錯誤原因:輸入值應該小于后面表格欄位值,大于前面表格欄位的值。"; document.getElementById("show").style.display="block"; document.getElementById("save").disabled="true"; }else{ checkSuccess(); } } var j=document.getElementById("recordtext").value; if(c==j-1) { var d=Math.round(c)-1; var before="1_"+d; var a=document.getElementById(before).value; var e=a.substring(0,a.length-1); var f=document.getElementById(you).value; alert('f2='+f+'_a='+a); var g=f.substring(0,f.length-1); var h=Math.round(e); var i=Math.round(g); if(i<h) { document.getElementById("warning").value="錯誤位置﹕第2行﹐第"+j+"欄。"+"錯誤原因:輸入值應該小于后面表格欄位值,大于前面表格欄位的值。"; document.getElementById("show").style.display="block"; document.getElementById("save").disabled="true"; }else{ checkSuccess(); } } if(c<j-1 && c>0) { var d=Math.round(c)-1; var l=d+2; var before="1_"+d; var behind="1_"+l; var a=document.getElementById(before).value; var k=document.getElementById(behind).value; var e=a.substring(0,a.length-1); var m=k.substring(0,k.length-1); var f=document.getElementById(you).value; var g=f.substring(0,f.length-1); //var h=Math.round(e); //var i=Math.round(g); //var i=Math.round(m); var h =Math.pow(e,3); var i=Math.pow(g,3); var n=Math.pow(m,3); if(i<h || i>n) { document.getElementById("warning").value="錯誤位置﹕第2行﹐第"+l+"欄。"+"錯誤原因:輸入值應該小于后面表格欄位值,大于前面表格欄位的值。"; document.getElementById("show").style.display="block"; document.getElementById("save").disabled=true; } else { checkSuccess(); } } } function checkSuccess(){ document.getElementById("show").style.display='none'; document.getElementById("save").disabled=false; } function reset1() { document.getElementById("show").style.display="none"; document.getElementById("save").disabled=false; } function savehidden(oid) { //alert("ddd"); var a=oid; var b=a.substring(2,a.length); var c="1_"+b; var d=document.getElementById(c).value; //alert(d); var e="w_"+b document.getElementById(e).value=d; } //Ajax------------------------------------- var myAjax; function first() { var a=document.getElementById("subid").value; var url="<%=request.getContextPath()%>/tms/testdrive/teststatus.do?method=DailyProgressAjax&&subid="+a+"&&start1="+document.getElementById("start1").value+"&&end1="+document.getElementById("end1").value; second(url); } function second(url){ myAjax = new Ajax(url,{method: 'post',onComplete:third}); myAjax.setHeader('RequestType','ajax'); myAjax.request(); } function third(txt,xml) { //alert(xml.xml); var len=document.getElementById("recordtext").value; var tag=xml.getElementsByTagName("str"); if(tag.length>0) for(var i=0;i<len;i++) { document.getElementById("1_"+i).value=tag[i].firstChild.nodeValue+"%"; } } function getSave() { var recordtext = document.getElementById("recordtext").value; var subid = document.getElementById("subid").value; var start1 = document.getElementById("start1").value; var end1 = document.getElementById("end1").value; document.myform.action = 'teststatus.do?recordtext='+recordtext+'&subid='+subid+'&start1='+start1+'&end1='+end1; document.myform.submit(); } </script>
Daily Progress
result=(List) request.getAttribute("tdpmlist"); Integer alen=result.size(); if(result!=null && result.size()>0) { System.out.println("Hello World!"); } long end = Long.parseLong(request.getAttribute("end1").toString()); long start =Long.parseLong(request.getAttribute("start1").toString());//select start SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //System.out.println("=start="+sdf.format(start)); //System.out.println("=end="+sdf.format(end)); String t = sdf.format(new Date()); long today = 0; try { today = sdf.parse(t).getTime(); } catch (ParseException e) { e.printStackTrace(); } %>
today){ countDay = (end - today)/(1000*3600*24); int passDay = 0; for(j=i;j<countday passday="passDay" string s="" try java.util.date tempday='sdf.parse("2002-02-28");' long tempday2="1000*3600*24*passDay" today tempday.settime catch e e.printstacktrace><td> <input type="text" value="&lt;%=s%&gt;" id="&lt;%=0%&gt;_&lt;%=j%&gt;" name="&lt;%=0%&gt;_&lt;%=j%&gt;" readonly> </td> </countday> 3) //{ //str=str.substring(0,3); //} str=str+"%"; //System.out.println("r="+r+"___str=="+str); planStr = str; planId =id; %> today){ for(j=i;j<countday><td> <input type="text" id="&lt;%=1%&gt;_&lt;%=j%&gt;" name="&lt;%=1%&gt;_&lt;%=j%&gt;" value="&lt;%=planStr%&gt;" onchange="check1(this.id)"><input type="hidden" id="w_&lt;%=j%&gt;" name="w_&lt;%=j%&gt;"><input type="hidden" id="3_&lt;%=j%&gt;" name="3_&lt;%=j%&gt;" value="&lt;%=planStr%&gt;"><input type="hidden" id="4_&lt;%=j%&gt;" name="4_&lt;%=j%&gt;" value="&lt;%=planId%&gt;"> </td> </countday> 3) { str=str.substring(0,4); } str=str+"%"; } else { str="N/A"; } actualStr=str; %> today){ for(j=i;j<countday><td> <input type="text" value="&lt;%=actualStr%&gt;" id="&lt;%=2%&gt;_&lt;%=j%&gt;" name="&lt;%=2%&gt;_&lt;%=j%&gt;" readonly> </td> </countday>
Date <!-- <input type="button" value="Edit" id="button_<%=0%>_<%=temp%>" onclick="myedit(this.id)"> -->
Plan
Actual




你可能感兴趣的:(java,c,css,C#,J#)