You are here: DEVPPL Forum Programming HTML Forum Script-archive
NOTIFICATIONS
54.311
MEMBERS
15.720
TOPICS
62.398
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

Html for day,date and year

Share your completed scripts.
0

Loading

Html for day,date and year

Postby Kakarot_ » Sun Apr 15, 2007 12:43 pm

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 + "," + "&nbsp;" + date + "<sup>" + suffix + "</sup>" + "&nbsp;" +
month + "," + "&nbsp;" + year);
}
// -->
</script>
<script>
<!--
print_date();
//-->
</script>
Kakarot_
 
Reputation: 0
Posts: 9
Joined: Sun Mar 25, 2007 11:40 am
Highscores: 0
Arcade winning challenges: 0

Html for day,date and year - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Postby Tomi » Sun Apr 15, 2007 1:15 pm

Thanks for sharing :) im sure webmaster will put this into the script archive.
Tomi
 
Reputation: 0
Posts: 925
Joined: Mon Jun 26, 2006 7:51 pm
Location: Essex, England
Highscores: 0
Arcade winning challenges: 0
0

Loading

Postby SalmonBoy » Mon Nov 19, 2007 6:00 am

Ooh, I did that once to the status bar, but I'd forgotten the code. Thanks man.
SalmonBoy
 
Reputation: 0
Posts: 24
Joined: Fri Nov 16, 2007 4:42 am
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Html for day,date and year

Postby Pioneer » Fri Jan 08, 2010 12:35 pm

Could you tell me the code for changing the font to Garamond?

Thanks
Pioneer
 
Reputation: 0
Posts: 1
Joined: Fri Jan 08, 2010 12:25 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: Html for day,date and year

Postby Dflynn » Sat Jan 09, 2010 1:59 am

pioneer wrote:Could you tell me the code for changing the font to Garamond?

Thanks

You don't need javascript to change the font to Garamond, you are looking for CSS.
Make the

font-family: "Garamond", ... ;

in the css that affects the layer you are calling this in:
Code: Select all
<script>
<!--
print_date();
//-->
</script>


Should do it.
Dflynn
 
Reputation: 0
Posts: 860
Joined: Wed Oct 03, 2007 10:06 pm
Location: Guelph, Canada
Highscores: 0
Arcade winning challenges: 0
^ Back to Top