[code snippet] Dynamic copyright year

If you're involved at all with websites, there's a reasonable chance that your first e-mail of 2005 will be marked with a red bang (!) and have the following subject line:

IMPORTANT! CHANGE COPYRIGHT FOR ALL PAGES IN WEBSITE TO 2005!!! [1]

Hopefully, you've encapsulated this code in a user control or something, so it's not too big a deal... change 2004 to 2005... dum de dum... check in code... go on to next e-mail...

Then your first e-mail of 2006 will likely read:

IMPORTANT! CHANGE COPYRIGHT FOR ALL PAGES IN WEBSITE TO 2006!!!

Why not take the chance to solve this problem once and for all? This is the chance to ring in the new year with some EXTREME CODE!!! Dynamic year population! [2]

Copyright 1998 - <%= DateTime.Now.Year.ToString() %> Mega Corp., Inc.

Note to self: The only way to top this posting in 2005 is to write the AutoUpdateCopyright server control...

-----

[1] I've been told that the act of publishing something on a website confers a copyright. Bah. You'll still get paged at 6 AM on January 1 every year.

[2] Note: Code in bold red is EXTREME CODE and must not be edited. Please do not attempt to understand EXTREME CODE block as it may drive you to madness.

-----

powered by IMHO

No Comments