Dynamic copyright

Freshness Warning
This blog post is over 15 years old. It's possible that the information you read below isn't current and the links no longer work.

Brad Feld wants to know if you’ve updated your copyright dates and suggests you put them in an include for update-once ease.

Most sites I’ve built take this a step further—the dates are dynamic. Copyright dates are often a range, and of course the first date doesn’t change. But the last date is always current with a dynamic copyright.

In Movable Type, you can use this...

&copy; 1996 - <MTDate format="%Y">

In PHP...

echo '&copy; 1996 - ' . date('Y');

And in Smarty...

&copy; 1996 - {$smarty.now|date_format:"%Y"}

Dave Kaufman - Techlife
January 1, 2007 1:57 PM

Interesting and useful...now the dumb question.... in HTML? or if your Apache webserver has PHP and the page is .html can you use the PHP?

Adam Kalsey
January 1, 2007 2:01 PM

Only if your web server is set up to process .html pages as PHP. If you're using Apache, adding the following to your .htaccess file should do the trick (assuming that PHP is already set up on your server)... `AddType application/x-httpd-php .html` But don't do this lightly. There's performance and server load considerations to think about. This means that every .html page on your server will be processed for PHP, regardless of whether you actually put any PHP code in there.

January 21, 2007 11:37 AM

Very helpful notes on Apache and .htaccess...thanks Adam. Viv

This discussion has been closed.

Recently Written

The Trap of The Sales-Led Product (Dec 10)
It’s not a winning way to build a product company.
The Hidden Cost of Custom Customer Features (Dec 7)
One-off features will cost you more than you think and make your customers unhappy.
Domain expertise in Product Management (Nov 16)
When you're hiring software product managers, hire for product management skills. Looking for domain experts will reduce the pool of people you can hire and might just be worse for your product.
Strategy Means Saying No (Oct 27)
An oft-overlooked aspect of strategy is to define what you are not doing. There are lots of adjacent problems you can attack. Strategy means defining which ones you will ignore.
Understanding vision, strategy, and execution (Oct 24)
Vision is what you're trying to do. Strategy is broad strokes on how you'll get there. Execution is the tasks you complete to complete the strategy.
How to advance your Product Market Fit KPI (Oct 21)
Finding the gaps in your product that will unlock the next round of growth.
Developer Relations as Developer Success (Oct 19)
Outreach, marketing, and developer evangelism are a part of Developer Relations. But the companies that are most successful with developers spend most of their time on something else.
Developer Experience Principle 6: Easy to Maintain (Oct 17)
Keeping your product Easy to Maintain will improve the lives of your team and your customers. It will help keep your docs up to date. Your SDKs and APIs will be released in sync. Your tooling and overall experience will shine.


What I'm Reading


Adam Kalsey

+1 916 600 2497


Public Key

© 1999-2022 Adam Kalsey.