I am trying to get JavaScript to display tomorrows date in format (dd-mm-yyyy)
I have got this script which displays todays date in format (dd-mm-yyyy)
Its really simple:
1: Create date object with today' date and time. 2: Use date object methods to retrieve day, month and full year and concatenate them using the + operator.
Visit http://www.thesstech.com/javascript/date-time JavaScript for detailed tutorial on date and time.
Sample Code:
var my_date = new Date();
var tomorrow_date = (my_date .getDate()+1) + "-" + (my_date .getMonth()+1) + "-" + my_date .getFullYear();
document.write(tomorrow_date);