How to get month name from Date object in JavaScript.
var mydate = "2025/01/31" var month = ?;
How to get the Month as January?
Hi makenzi.exc,
Refer below example.
HTML
<html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> body { font-family: Arial; font-size: 10pt; } </style> </head> <body> <script type="text/javascript"> function GetMonthName() { // Date object. var dt = new Date("2025/01/31"); // Get Month name using toLocaleDateString. alert("Month name is " + dt.toLocaleDateString("en-IN", { month: 'long' })); }; </script> <input type="button" value="Submit" onclick="GetMonthName()" /> </body> </html>
Demo
Screenshot
Downloads
Download Sample
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.