Thursday, November 26, 2009

JavaScript - Get yesterday Date

Get the yesterday Date by using Javascript

var today = new Date(); // Get today date.
today.setDate(today.getDate() - 1); // Get yesterday date.
var date = today.getDate(); // Get the numerical date
var year = today.getYear(); // Get the year
var month = today.getMonth()+1; // Get the monthvar yesterdayDate = month+'/'+date+'/'+year;
Related Posts Plugin for WordPress, Blogger...