[RESOLVED]C# Getting the year with out declaring a variable.

I am trying to put the current year at the bottom of my website for copy right reasons.  I am using razor and my files are cshtml.

in the footer layout page I have mostly HTML, the code there is the @rednderBody() and a Layout to bring in the other layout pages.

The code I am trying is this,

<br>@System.DateTime.Year(Now); &copy;

I want to beable to print the current year without having to declare a variable.

Thanks.

@System.DateTime.Now.Year

Thank you.

Leave a Reply