How to get the moon in English on a date

Asked 2 years ago, Updated 2 years ago, 109 views

For example, how can I get January? var objDate = new Date("01/11/2016");

javascript date

2022-09-22 15:20

1 Answers

var monthNames = ["January", "February", "March", "April", "May", "June",
  "July", "August", "September", "October", "November", "December"
];

var d = new Date();
document.write("The current month is " + monthNames[d.getMonth()]);

I did it in an arrangement.


2022-09-22 15:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.