homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Copyright Date
How To Automatically Keep Current

 1:15 am on Mar 21, 2005 (gmt 0)

At the bottom of each of my web pages, I have a copyright and 2001 - 2005. Is there a script I can use instead of 2005 so that it will automatically change to the current year. This way when 2006 rolls around, I don't have to change each page.

I tried using Includes in a footer, but kept having problems because not all of my pages are PHP. I inherited this web site and don't have time to go back and make each page PHP and use includes footers. So I was hoping a simple script existed to show the current year.




 2:14 am on Mar 21, 2005 (gmt 0)

If you are using a PHP include, I would consider using htaccess to parse your HTML files as php, and then use an include.


 2:32 am on Mar 21, 2005 (gmt 0)

If you're using asp, just put DatePart("yyyy", Now) where you want the current year to appear.

Recommend not using Javascript -- the people that don't have jscript turned on (very few) will see 1997-(nothing) as will the spiders.


 6:22 am on Mar 21, 2005 (gmt 0)

I do recommend using javascript in your case. Forget the few not having Javascript (not even 1.0) as for search engines why would you care for the copyright year?


 6:36 am on Mar 21, 2005 (gmt 0)

Years ago, I did a graphic on a website for the copyright information. Once a year, I updated the graphic.


 1:47 pm on Mar 21, 2005 (gmt 0)

I played around with several things and think the Javascript may work fine for me. Is this the simplest code?

<script type="text/javascript">
var theDate=new Date()

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved