共用方式為


SPUtility.TimeDeltaAsString Method

Returns the difference between two specified DateTime values as a string.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Shared Function TimeDeltaAsString ( _
    dtEarlierTime As DateTime, _
    dtLaterTime As DateTime _
) As String
'Usage
Dim dtEarlierTime As DateTime
Dim dtLaterTime As DateTime
Dim returnValue As String

returnValue = SPUtility.TimeDeltaAsString(dtEarlierTime, _
    dtLaterTime)
public static string TimeDeltaAsString(
    DateTime dtEarlierTime,
    DateTime dtLaterTime
)

Parameters

  • dtEarlierTime
    Type: System.DateTime

    A System.DateTime object that contains the earlier date and time.

  • dtLaterTime
    Type: System.DateTime

    A System.DateTime object that contains the later date and time.

Return Value

Type: System.String
A string that contains the difference between the two times.

See Also

Reference

SPUtility Class

SPUtility Members

Microsoft.SharePoint.Utilities Namespace