jtrecords@yahoo.com wrote:[color=blue]
> I truly tried to get this one on my own...
>
> I am new to javascript, like 2 hours ago.
> So I'm messing with an example that inserts the current date in an html
> page. I want to keep the example and have my stylesheet fonts applied.
>
>
> Would someone kindly give me an example of how to get this done? Do I
> modify the document.write and where?
>
> ::excerpt from test.html::
>
> today = days[now.getDay()] + ", " +
> months[now.getMonth()] + " " +
> date + ", " +[/color]
You probably want to remove the 'date + ...' line
[color=blue]
> (fourdigits(now.getYear())) ;[/color]
getFullYear() is pretty widely supported, so why not:
now.getFullYear();
For messing with date and time formats, have a read of Dr. J's pages:
<URL:http://www.merlyn.demon.co.uk/js-index.htm>
[color=blue]
>
> // Print out the data.
> document.write("" +today+ "");[/color]
document.write('<p class="someClass" '
+ 'style="font-family: sans-serif;">'
+ today + '<\/p>');
[color=blue]
>
> TIA!
> JT
>[/color]
--
Rob