Hi I need to create a date that is 21 days in the future and output it in this format: mm/dd/yyyy
I have this:
var d = new Date();
d.setDate(d.getDate() + 21);
var formattedDate = d.getMonth() + '/' + d.getDate() + '/' + d.getFullYear()
alert(formattedDate);
I get 3/2/2008 for formatted date. However, when I output d variable I get the correct date in the future. Whats wrong with formatting?
Thnaks
I have this:
var d = new Date();
d.setDate(d.getDate() + 21);
var formattedDate = d.getMonth() + '/' + d.getDate() + '/' + d.getFullYear()
alert(formattedDate);
I get 3/2/2008 for formatted date. However, when I output d variable I get the correct date in the future. Whats wrong with formatting?
Thnaks