It is now possible to do this with the ECMAScript Internationalization API.
We use the ECMAScript Internationalization API to get the long name, short name and narrow name for the month.
Let's see this in an example.
From the example, we can see that we used created a new constant called dateToday and we assigned it the new Date().
From the dateToday, we used the toLocaleString() method and provided the locales and options to it.
In the last example, we saw how we could get the current month name from the current date.
In the following example, we will learn that because the method .toLocaleString() is on the date object, you can pass in a date of your choice.