Comment puis-je convertir une chaîne en une date en JavaScript? var st = "date in some format" var dt = new date(); var dt_st= //st in date format same as dt
J'ai une chaîne dans ce format: var testDate = "Fri Apr 12 2013 19:08:55 GMT-0500 (CDT)" Je voudrais utiliser moment.js pour l'obtenir dans ce format mm/dd/yyyy : 04/12/2013pour l'affichage. J'ai essayé de le faire en utilisant cette méthode, moment(testDate,'mm/dd/yyyy'); Quelles erreurs et dit there is no such method called replace? …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.