ASP.NET Tip: Automatically Update your Copyright Date

Posted by Joe Levi on January 10, 2008 at 2:59 pm.

If you’re like me you’ve got a whole slew of web pages that you’ve developed. That means you’ve got a lot of pages to modify every year to update the copyright to reflect the new year.

Instead of hard-coding the year in to your xhtml, replace it with the following code snippet and you’re all set!

   1:  <%= System.DateTime.Today.Year.ToString() %>

You can thank me later. ;)

kick it on DotNetKicks.com

Help pay off Joe's mortgage Was this information helpful? Why not consider a donation to help pay off my mortgage?

One Comment

Trackbacks / Pingbacks

Leave a Reply