Introduction
In JavaScript, we may need to format a date to dd-MMM-yyyy. We'll examine how to do it in this tutorial.
To format a date to dd-MMM-yyyy
in JavaScript we need to create a dedicated function called formatDate()
:
To present a date in dd-MMM-yyyy
format use the following:
Conclusion
In this post, we presented the best way to format a date to dd-MMM-yyyy
in JavaScript. You can use this function to present a Date in other formats:
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}