javascript Date.parse - Stack Overflow The (Link->http://ift.tt/1qp2jII...

Please Visit: http://ift.tt/1ajReyV



javascript Date.parse - Stack Overflow



The (Link->http://ift.tt/1qp2lAs) ).

I would recommend you to parse your date string manually, and use the Date constructor (Link->http://ift.tt/1oaCRJW) with the year, month and day arguments to avoid ambiguity:

// parse a date in yyyy-mm-dd format

function parseDate(input) {

var parts = input.split('-');

// new Date(year, month [, day [, hours[, minutes[, seconds[, ms]]]]])

return new Date(parts[0], parts[1]-1, parts[2]); // Note: months are 0-based

}

http://ift.tt/1qp2jIV

http://ift.tt/1oaCRK6



javascript Date.parse - Stack Overflow







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qp2jZh

via LifeLong Community

No comments:

Post a Comment