Welcome to WebmasterWorld Guest from 54.145.23.244

Forum Moderators: phranque

Message Too Old, No Replies

Copyright Date

How To Automatically Keep Current

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

New User

10+ Year Member

joined:Nov 17, 2004
posts:16
votes: 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.

Thanks,
Jim

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 6, 2003
posts:2523
votes: 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)

Junior Member

10+ Year Member

joined:July 19, 2004
posts:178
votes: 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)

Junior Member

10+ Year Member

joined:Feb 20, 2004
posts:139
votes: 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)

New User

10+ Year Member

joined:Oct 14, 2003
posts:27
votes: 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)

New User

10+ Year Member

joined:Nov 17, 2004
posts:16
votes: 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()
document.write(theDate.getFullYear())
</script>

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members