javascript - Convert time format to iso format -
i need convert date format : fri jul 29 2016 00:00:00 gmt+0100 (maroc (heure d’été)) (i don't call way ) iso format (yyyy-mm-dd 00:00:00.000 ) using javascript in advance
here sample snippet query. hope helps query.
function formatdate(date) { var d = new date("fri jul 29 2016 00:00:00 gmt+0100"), month = '' + (d.getmonth() + 1), day = '' + d.getdate(), year = d.getfullyear(); if (month.length < 2) month = '0' + month; if (day.length < 2) day = '0' + day; return [year, month, day].join('-'); }
Comments
Post a Comment