Click to See Complete Forum and Search --> : working with dates!


pelegk1
06-18-2003, 04:09 AM
is there a way to know the correct date
in 20 dys,150 days from today?
to add the current date+number of days=recive new date?
thanks in advance
Peleg

Charles
06-18-2003, 05:36 AM
<script type="text/javascript">
<!--
Date.ONE_SECOND = 1000;
Date.ONE_MINUTE = Date.ONE_SECOND * 60;
Date.ONE_HOUR = Date.ONE_MINUTE * 60;
Date.ONE_DAY = Date.ONE_HOUR * 24;

Date.prototype.getDateInDays = function (d) {return new Date(this.getTime() + d * Date.ONE_DAY)}

now = new Date();
alert (now.getDateInDays(7));
// -->
</script>