Spread WPF 17
GrapeCity.CalcEngine Namespace / CalcConvert Class / ToTimeSpan Method
The value to be converted.


In This Topic
    ToTimeSpan Method
    In This Topic
    Syntax
    'Declaration
     
    Public Shared Function ToTimeSpan( _
       ByVal value As Object _
    ) As TimeSpan
    'Usage
     
    Dim value As Object
    Dim value As TimeSpan
     
    value = CalcConvert.ToTimeSpan(value)
    public static TimeSpan ToTimeSpan( 
       object value
    )

    Parameters

    value
    The value to be converted.

    Return Value

    A System.TimeSpan indicates the converted result.
    Exceptions
    ExceptionDescription
    Can not convert value to System.TimeSpan
    Remarks
    Using System.TimeSpan.FromDays(System.Double) to convert value to convert, if value is not double, first explicitly convert it then to date time. If value is a null reference (Nothing in Visual Basic), pass 0d to System.TimeSpan.FromDays(System.Double). If value is System.String, try parsing with current culture. If value is System.DateTime, pass OADate of value to System.TimeSpan.FromDays(System.Double).
    See Also