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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -