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 is less than 1 minute and ts.Milliseconds=0, returns "0:ss".
    If ts is less than 1 minute and ts.Milliseconds!=0, returns "0:ss.iii".
    If ts is less than 1 hour, returns minutes and seconds "m:ss".
    If ts is greater than 1 hour, returns hours, minutes, and seconds "h:mm:ss". If ts is greater than 24 hours, returns days, hours, minutes, and seconds "d:h:mm:ss".
    See Also