Insert smart formet current date in your webpage


To insert current date in your website or webpage, just copy below code and past it on to where you want to view date,

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: mhshohel
// URL: http://talkfromnet.blogspot.com
// Use the script, just leave this message intact.
// contact person: mhshohel89@gmail.com

// ***********************************************

// Get today's current date.
var now = new Date();

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

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

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// Print out the data.
document.write("Today\'s date is " +today+ ".");

//--></SCRIPT>

If You Like This. Please! Drop a Comment And Share This...

0 comments:

Post a Comment

 

Copyright 2009-2012. All Rights Reserved by Talkfromnet.blogspot.com...About Author: MHSHOHEL