How to Date Display with JavaScript Snippets

Add Tool

Date Display with JavaScript


Date Display with JavaScript

You can use this snippet to display the current date in this format: Sunday, February 19, 2017. Just paste the following code where you want the date display on your page:

<SCRIPT LANGUAGE="JavaScript">
var now = new Date();

var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
        }
today =  days[now.getDay()] + ", " +
        months[now.getMonth()] + " " +
        date + ", " +
        (fourdigits(now.getYear())) ;

document.write(today);
</script>

Source


Tags: JavaScript, Date Display with JavaScript. Date Display, macbook air retina display release date, retina display release date, javascript display date, digital clock date and time display
Payza

About Masum Billah

Date Display with JavaScript 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: How to Date Display with JavaScript Snippets


Recently Viewed Items
adf.ly