jecommera
asked on
handlings dates in javascript
Hi,
I am practicing some JS and have the following question:
An invoice is due and payable in 90 days. Write a function that will display that
date.
I have got as far as the following code however of course this just returns a number.
var now = new Date();
invoice_date = now.getDate()+90;
document.write(invoice_dat e);
Can someone advise the best way to manage this?
I am practicing some JS and have the following question:
An invoice is due and payable in 90 days. Write a function that will display that
date.
I have got as far as the following code however of course this just returns a number.
var now = new Date();
invoice_date = now.getDate()+90;
document.write(invoice_dat
Can someone advise the best way to manage this?
This returns full date:
<script type="text/javascript">
var myDate=new Date();
myDate.setDate(myDate.getD ate()+90);
alert(myDate);
</script>
<script type="text/javascript">
var myDate=new Date();
myDate.setDate(myDate.getD
alert(myDate);
</script>
ASKER
Can I get it as just month and date
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This article may also be of interest: https://www.experts-exchange.com/A_484-Can-I-have-a-date.html
var d=new Date();
var milliseconds = d.getTime() + (90*24*60*60*1000);
document.write(new Date(milliseconds));