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 %>
Domanda
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?
Soluzione
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 %>