Come posso convertire una stringa in una data in JavaScript? var st = "date in some format" var dt = new date(); var dt_st= //st in date format same as dt
Ho una stringa in questo formato: var testDate = "Fri Apr 12 2013 19:08:55 GMT-0500 (CDT)" Vorrei usare moment.js per ottenerlo in questo formato mm/dd/yyyy : 04/12/2013per la visualizzazione. Ho provato a farlo usando questo metodo, moment(testDate,'mm/dd/yyyy'); Quali errori e dice there is no such method called replace? mi sto …
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.