现在的位置: 首页 > 综合 > 正文

js//初始话日期

2013年04月09日 ⁄ 综合 ⁄ 共 566字 ⁄ 字号 评论关闭

function InitDate()
{
  var today = new Date();
  var strTime=today.getYear();
  if (today.getMonth()<9) strTime=strTime+'/0'+(today.getMonth()+1);else  strTime=strTime+'/'+(today.getMonth()+1);
  if (today.getDate()<10) strTime=strTime+'/0'+today.getDate();else  strTime=strTime+'/'+today.getDate();
   document.all("Date_S").value=strTime;
   document.all("Date_E").value=strTime;
}

initDate();

//初始话日期
function initDate()
{
 var d = new Date();
 var s = "";
 s = s + d.getYear() + "/";
 s = s + (d.getMonth() + 1) + "/";
 s = s +  d.getDate();
 document.all("P.Q_RQEND").value = s ;
 document.all("P.Q_RQ").value = addDays(s,-30);
}

抱歉!评论已关闭.