I am doing an MVC 6 Application.
I need to get the difference in YEAR between 2 dates in the View.
I have this
Years(Convert.ToDateTime(date1), Convert.ToDateTime(date2))
in the controller. But I need to do something similar in the cshtml
I only could do
var dateC = (Convert.ToDateTime(date2) - Convert.ToDateTime(date1)).Days;
But I get the days.. I could not find the way to return the years.
thanks