Search code examples
c#htmlumbraco

Umbraco c# year creator


I'm looking to create a auto year bit of code, which will save anyone going into the system every year to change the copyright date from 2013 to 2014, does anyone know of any code that does this?


Solution

  • Try this (in a Razor view, available from v4.6)

    @DateTime.Now.Year
    

    If you are using older master pages, you can use this:

    <%= DateTime.Now.Year %>