How to Get Current Year in C#/CSharp

To get current year in C#/CSharp, we make use of DateTime class.  Example is given below.

using System;

namespace Hello_World
{

    class Program
    {
        static void Main(string[] args)
        {
            DateTime current = DateTime.Now;

            Console.WriteLine(current.Year);
        }
    }
}
;