const date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
This information is available on the Mozilla Development Network (MDN): Intl.DateTimeFormat MDN Web Documents
You may have a date in the form of a DateString, for example: "Thu October 3, 2019." Having this, we can convert it to the format we need, but first we need to convert this string into an object containing information about the date:
let convertedDate = new Date("Thu Oct 03 2019")
Then we can convert the date to the format we need:
let FinalDate = new Intl.DateTimeFormat('en-GB').format(convertedDate)
Change "en-GB" to "en-US", if you live in the United States, look for other formats, if you do not need them, you can always see the codes of other languages ββhere:
Locale Language Codes
source share