<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<title>返回/设置时间方法</title>
</head>
<script>
function mySelect()
{
var mydate=new Date(); //获取当前日期
document.write("当前日期为"+ mydate+"<br>"); // 输出当前日期
mydate.setTime(mydate.getTime()-2*60*60*1000);
document.write("后来日期为:"+mydate); // 输出后来日期
}
</script>
<body>
<div>
<input type="button" value="让时间 倒退两小时" onclick="mySelect()">
</div>
</body>
</html>