Html for day,date and year
|
| View previous topic :: View next topic |
| Author |
Message |
kakarot_90
Joined: 25 Mar 2007 Posts: 9
|
Posted: Sun Apr 15, 2007 12:43 pm Post subject: Html for day,date and year |
|
|
Ever wanted to put date on ur site?Cut & paste the below code.
<script language="JavaScript" type="text/javascript">
<!--
var
month = new Array();
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";
var
day = new Array();
day[0]="Sunday";
day[1]="Monday";
day[2]="Tuesday";
day[3]="Wednesday";
day[4]="Thursday";
day[5]="Friday";
day[6]="Saturday";
today = new Date();
date = today.getDate();
day = (day[today.getDay()]);
month = (month[today.getMonth()]);
year = (today.getFullYear());
suffix = (date==1 || date==21 || date==31) ? "st" : "th" &&
(date==2 || date==22) ? "nd" : "th" && (date==3 || date==23) ? "rd" : "th"
function print_date()
{
document.write(day + "," + " " + date + "<sup>" + suffix + "</sup>" + " " +
month + "," + " " + year);
}
// -->
</script>
<script>
<!--
print_date();
//-->
</script> |
|
| Back to top |
|
 |
|
|
Tomi 500+ Club

Joined: 26 Jun 2006 Posts: 783
|
Posted: Sun Apr 15, 2007 1:15 pm Post subject: Re: Html for day,date and year |
|
|
Thanks for sharing im sure webmaster will put this into the script archive. |
|
| Back to top |
|
 |
SalmonBoy11

Joined: 16 Nov 2007 Posts: 22
|
Posted: Mon Nov 19, 2007 6:00 am Post subject: Re: Html for day,date and year |
|
|
| Ooh, I did that once to the status bar, but I'd forgotten the code. Thanks man. |
|
| Back to top |
|
 |
|
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums. Click here to Register
If you are a current member here on DEVPPL, please login below:
|
|
|
|