<script type="text/javascript" language="javascript">
//获取系统时间
var LSTR_ndate=new Date();
var LSTR_Year=LSTR_ndate.getYear();
var LSTR_Month=LSTR_ndate.getMonth();
var LSTR_Date=LSTR_ndate.getDate();
var LSTR_Hours=LSTR_ndate.getHours();
var LSTR_Minutes=LSTR_ndate.getMinutes();
//处理
var uom = new Date(LSTR_Year,LSTR_Month,LSTR_Date,LSTR_Hours,LSTR_Minutes);
var uommonth = new Date(LSTR_Year,LSTR_Month,LSTR_Date);
uom.setDate(uom.getDate()-(uom.getDay()-7)-7*1);//取得系统时间的前一天,重点在这里,负数是前几天,正数是后几天
var LINT_MM=uom.getMonth();
LINT_MM++;
var LSTR_MM=LINT_MM > 10?LINT_MM:("0"+LINT_MM)
var LINT_DD=uom.getDate();
var LSTR_DD=LINT_DD > 10?LINT_DD:("0"+LINT_DD)
//得到最终结果
//uom = uom.getFullYear() + "-0" + uom.getMonth() + "-"+LSTR_DD+" "+"00"+":"+"05";
uom = uom.getFullYear() + "-" +LSTR_MM+ "-"+LSTR_DD+" "+"00"+":"+"05";
function show()
{
document.getElementById("txt_one").value=uom;
} </script>
05-20 18:34