JavaScript obtient 1 heure à partir de maintenant
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
Stormy Skunk
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
<html>
<head>
<title>JavaScript setHours Method</title>
</head>
<body>
<script>
var dt = new Date();
dt.setHours( dt.getHours() + 2 );
document.write( dt );
</script>
</body>
</html>