PDA

View Full Version : Adding date to website



dew
07-08-2008, 08:37 PM
Im creating a website (not yet published) & I want to add today's date (automatically updating). How do I do this?

Main website is www.galwoliecottage.com (http://www.galwoliecottage.com) but new one has no domain yet! Hope you can still help.

Denise

Karen Mac
07-08-2008, 08:41 PM
Try dynamicdrive.com for a date/time script

Karen

dew
07-08-2008, 08:47 PM
thanks Karen, but theres nothing on it just for date,as far as I can see.

Denise

Collectors-info
07-08-2008, 08:55 PM
Hi, you can paste this below into a html box.

<script language="JavaScript">
<!--
var now = new Date();
var days = new Array(
'Sun','Mon','Tues',
'Wednes','Thurs','Fri','Sat');
var months = new Array(
'Jan','Feb','Mar','Apr','May',
'June','July','Aug','Sept','Oct',
'Nov','Dec');
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>

dew
07-08-2008, 10:05 PM
CHris, when I paste that into my HTML box, and then go to preview it, the date box doesnt appear. Am I missing something?

Denise

Bethers
07-08-2008, 10:37 PM
Your computer is blocking it from being shown in preview. You're probably getting a notice on top of the screen that some content is blocked - click on that to allow that content and it will show. Or just publish :)

dew
07-08-2008, 11:21 PM
Bethers - THanks, thats great! Its my husbands site and hes working on domain name, etc at the moment so cant publish yet. He wants to know now, can the font be changed for that html code?

Bethers
07-09-2008, 02:56 AM
The way that code is written, it's using the default font chosen for your page. If you want a different font just for that code, yes it can be done, but you'll need to add it to the code using the following:

Before the code put:

<FONT style="FONT-SIZE:10pt" color="#FFFFFF" face="Georgia">

change the size and color and face to whatever you want.

After the code put:

</FONT>

Karen Mac
07-09-2008, 04:17 AM
Theres a ton of them on dynamic drive

http://dynamicdrive.com/dynamicindex6/index.html

Karen

Collectors-info
07-09-2008, 06:51 AM
Theres a ton of them on dynamic drive

http://dynamicdrive.com/dynamicindex6/index.html

Karen

Hi Karen, don't think there is a date only script on this site. which is strange

valwilson
07-09-2008, 10:40 AM
Hi Beth,
that worked perfectly! Thanks for your help.

Denise

Bethers
07-09-2008, 03:02 PM
Yvw