ASP.NET Tip: Automatically Update your Copyright Date

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

One Response to ASP.NET Tip: Automatically Update your Copyright Date

  1. Nick says:

    Worked perfectly, thanks!

Leave a Reply