Answer the question
In order to leave comments, you need to log in
How to convert date string to Date?
There is a string with a date in this format 11/22/2019 . You need to convert it to the Date format like this: Fri Nov 22 2019 00:00:00 GMT+0300 (Moscow Standard Time) . I also have date-fns connected to the project , can this be done with it?
Answer the question
In order to leave comments, you need to log in
Tyk
new Date("12.03.2019".replace(/(\d+)\.(\d+)\.(\d+)/, "$3-$2-$1"));
//Tue Mar 12 2019 03:00:00 GMT+0300 (Москва, стандартное время)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question