To Readable Age String - CSharp System

CSharp examples for System:DateTime Format

Description

To Readable Age String

Demo Code


using System;/*  w  w w.  j  av  a2  s . c  o  m*/

public class Main{
        public static string ToReadableAgeString(this TimeSpan span)
        {
            return string.Format("{0:0}", span.Days / 365.25);
        }
}

Related Tutorials