Create Month of Date

This commit is contained in:
LSvekis
2021-07-01 16:38:58 -04:00
committed by GitHub
parent 8723b37e33
commit 992e61390e
+9
View File
@@ -0,0 +1,9 @@
let today = new Date();
let future = new Date(2025, 5, 15);
console.log(future);
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
let day = future.getDate();
let month = future.getMonth();
let year = future.getFullYear();
let myDate = `${months[month]} ${day} ${year}`;
console.log(myDate);