I need to output the difference between 2 days in years, months and days.
With timespan and subtract i only get the days but is it possible to output in years, months and days.
This is what i have so far:
public string Leeftijdsverschil(DateTime p1, DateTime p2)
{
if (p1 > p2)
{
DateTime verschil = p1.Subtract(TimeSpan.FromTicks(p2.Ticks));
return verschil.ToString();
}
else
{
DateTime verschil = p2.Subtract(TimeSpan.FromTicks(p1.Ticks));
return verschil.ToString();
}
}