Total Days Ago - CSharp System

CSharp examples for System:DateTime Day

Description

Total Days Ago

Demo Code



public class Main{
        public static int TotalDaysAgo(this DateTime d)
        {/*from  w  ww  . j a  v a 2 s  . co m*/
            return Convert.ToInt32(Math.Round(DateTime.Now.Subtract(d.ToLocalTime()).TotalDays));
        }
}

Related Tutorials