Answers for "get the number of month from its name javascript"

24

Javascript get month name

var  months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var d = new Date();
var monthName=months[d.getMonth()]; // "July" (or current month)
Posted by: Guest on July-31-2019
0

convert month name to month number in js

month1 = month1.toLowerCase();
var months = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
month1 = months.indexOf(month1);
Posted by: Guest on April-05-2022

Code answers related to "get the number of month from its name javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language