adTempus API
ArcanaDevelopment.adTempus.Shared Namespace / DateTimeHandling Class / FormatTimespan Method
The timespan to format


In This Topic
    FormatTimespan Method
    In This Topic
    Formats a timespan into a readable format.
    Syntax
    'Declaration
     
    
    Public Shared Function FormatTimespan( _
       ByVal ts As Nullable(Of TimeSpan) _
    ) As String
    public static string FormatTimespan( 
       Nullable<TimeSpan> ts
    )
    public:
    static String^ FormatTimespan( 
       Nullable<TimeSpan> ts
    ) 

    Parameters

    ts
    The timespan to format
    Remarks
    If ts.TotalSeconds is less than 60 and ts.Milliseconds=0, returns "Xs".
    If ts.TotalSeconds is less than 60 and ts.Milliseconds!=0, returns "X.YYYs".
    If ts.TotalSeconds is less than 3600, returns minutes and seconds "Xm:YYs".
    If ts.TotalSeconds is greater than 3600, returns hours, minutes, and seconds "Xh:YYm:ZZs". If ts.TotalSeconds is greater than 24 hours, returns days, hours, minutes, and seconds "Dd:Xh:YYm:ZZs".
    See Also