frankyonnetti
8/12/2015 - 7:43 PM

#javascript #jquery Get today’s date.

Javascript - today’s date #javascript

// get today's date
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
// var year = date.getFullYear();
var todays_date = (('' + month).length < 2 ? '0' : '') + month + '-' + (('' + day).length < 2 ? '0' : '') + day;