I am trying to get today’s date with some specific format:
var d = new Date();
var curr_year = d.getFullYear();
var curr_Month = d.getMonth();
var curr_date = d.getDate();
var todayDate = (curr_year +"/"+curr_Month +"/"+ curr_date );
This is not working. What is the proper way of changing my date’s format?
In JavaScript, the months are zero based. For example:
Simply add one to your month:
Here’s a working fiddle.