Alina Anjum Alina Anjum - 1 year ago 83 Question

C# Get year part from date

I am converting an existing vb application to .net, in the existing code i found the condition below.How can I write this condition in C# ? Thanks in Advance

if CLng(Right(request("yr"),4))=CLng(Year(Date())) then
//I am confused only in Year(Date()) how can I replace these functions in C#


Year(Date()) can be written as DateTime.Now.Year