The following JavaScript Code snippet is used to display the Local date.
/* This function displays the date in Format */
/*For Today it will display Wednesday 1 Jul 2009
function getLocalDate() { var now = new Date(); var day = now.getDay(); var date = now.getDate(); var month = now.getMonth(); var year = now.getFullYear();
var DOW=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var MON=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
return DOW[day] + ' ' + date + ' ' + MON[month] + ' ' + year; }
SAMPLE USAGE
< font face="Tahoma" size="1" color="#ffffff" > < script language="javascript" >
document.write(getLocalDate());
< /script > < /font >
OUPUT
Wednesday 1 Jul 2009
|
No responses found. Be the first to respond and make money from revenue sharing program.
|