0

How can I convert date string to date object in javascript in yyyy-mm-dd format i.e 2021-06-10

let date = '2021-06-10' //typeof == string

or

let date = 2021-06-10T00:00:00.000Z  // I want only 2021-06-10 of type date and not string

the typeof must give me date type instead of string. I have tried toString(), toLocaleString() etc etc, all these gives me dates in string , but I have to set the value in form control so this must be of date type.

Any help!!

3

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.