const double daysToMonths = 30.4368499;
if (dtOne != null && dtTwo != null)
{
if (dtTwo.Value > dtOne.Value)
{
double days = (dtTwo.Value - dtOne.Value).TotalDays;
double months = Math.Round(days / daysToMonths);
double years = dtTwo.Value.Year - dtOne.Value.Year;
}
if (dtOne != null && dtTwo != null)
{
if (dtTwo.Value > dtOne.Value)
{
double days = (dtTwo.Value - dtOne.Value).TotalDays;
double months = Math.Round(days / daysToMonths);
double years = dtTwo.Value.Year - dtOne.Value.Year;
}
No comments:
Post a Comment