Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

3 letter months javascript array

var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var today = new Date();

// Show date in "dd-mm-yyyy' format.
var d = today.getDate();
var m = months[today.getMonth()];
var y = months.getFullYear();

console.log(d + "-" + m + "-" + y);
 
PREVIOUS NEXT
Tagged: #letter #months #javascript #array
ADD COMMENT
Topic
Name
8+2 =