Can someone assist me with converting Unixtime to a specific date format? Check out my current code below:
var date = "2014-05-01";
var indexPie = Date.parse(date);
I want indexPie in the yyyy-mm-dd format. However, when I try this line of code:
var newDate = new Date(indexPie);
The output shows:
Wed Apr 30 2014 18:00:00 GMT-0600 (Mountain Daylight Time)
But what I actually need is:
Thur May 01 2014 18:00:00 GMT-0600 (Mountain Daylight Time)
Any idea why new Date(indexPie) gives April 30 and how can I achieve my desired format of yyyy-mm-dd?
Your suggestions would be highly appreciated. Thank you.