Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am running my homepage on a server on my machine, the webpage has a copyright message at the bottom with the current year.
I used this javascript to make the year change automatically.<script language = 'JavaScript'>
function y2k(number)
{
return (number < 1000) ? number + 1900 : number;
}
var today = new Date();
var year = y2k(today.getYear());
document.write('Copyright ' + ' © ' + year + '. All Rights Reserved.');
//-->
</script>I ran the script and it worked fine, but when I changed the year on my computer (i.e the clock at the bottom of screen) and refreshed the page, it also changed.
Would normal clients be able to do the same thing, or is it just becuase I am the server.Thanks

Javascript runs in the browser on the clients machine. So the javascript date will be based upon the clients clock.
For your purpose, you want to get the date from the server. You'll need to use a server side language; PHP, JSP, perl, etc.
But - how is the copyright based upon the current date?? It would seem that it should be a fixed point in time that doesn't change.

CopyRight should be in this format, if I started building my website in 1999 and now it's 2004---> CopyRight 1999-2004
If you don't put the current year, then that means people can steal your text, images anything on website and you can't sue them.

"If you don't put the current year, then that means people can steal your text, images anything on website and you can't sue them."
This is not accurate. In the US, you have a copyright the moment you create your page. The copyright sign is only a notification of copyright. A common misconception.If you are worried about it, you should register your copyright, but this is not necessary.
It is also worth noting that US cooperates with many (most) countries on copyright laws, but not all of them. For a listing of countries and the nature of their copyright relations with the United States, see Circular 38a.
Go to copyright.gov and read the FAQ, as well as the various articles on "What does copyright protect?" and "Copyright basics."
As to the actual question, Don is correct...it will always show the client's time. If you're trying to stop people from making a different version of your web page (with a different copyright year), then don't even bother. They can just save a local copy and change the date manually.
Good luck,
-SN

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |