Best Jquery ,javascript, HTML5 CSS3 tutorial with jquery examples, php script , demos for beginners, web designers and web developers.

Jquery

Jquery Training

Jquery training blog

Pure Javascript date month year

Pure Javascript date month year   <!DOCTYPE html> <html> <body> <script> function formatDate(date) { var monthNames = [ “January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December” ]; var day = date.getDate(); var monthIndex = date.getMonth(); var year = date.getFullYear(); return day + ‘ ‘ + monthNames[monthIndex] + ‘ ‘ + year; Continue Reading


Pure Javascript date month year

 

<!DOCTYPE html>
<html>
<body>
<script>
function formatDate(date) {
var monthNames = [
"January", "February", "March",
"April", "May", "June", "July",
"August", "September", "October",
"November", "December"
];

var day = date.getDate();
var monthIndex = date.getMonth();
var year = date.getFullYear();

return day + ' ' + monthNames[monthIndex] + ' ' + year;
}

// Alternative od document ready in pure js

document.addEventListener('DOMContentLoaded', function(){
document.getElementById('today').innerHTML='Today is :' +formatDate(new Date());
});

 

</script>
<div id="today"></div>
</body>
</html>
Please follow and like us:






About the author

Joydeb Choudhury holds a Master's degree in Computer Application from I.G.N.O.U. After working as a web developer in various companies he has started bloging in 2016.

Recent Posts of blog

Downalod Free Php Scripts