How can I display today's date with minus 5 days in below format?
Today's date: 18/03/2016
Last sync date: 13/03/2016
I have tried the with below example though I am able to achieve today's date, not before 5 days date...
PS: I have tried with alert(todayDate) - 5 without luck :(
Any help please?
var d = new Date();
var month = d.getMonth()+1;
var day = d.getDate();
var todayDate = ((''+day).length<2 ? '0' : '') + day + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + d.getFullYear();
alert(todayDate);
I'm using jQuery if that's relevant.