SPUtility.CreateDateTimeFromSqlString Method

Converts the specified SQL string (in yyyymmdd hh:mm:ss format) to DateTime format.

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 CreateDateTimeFromSqlString ( _
    sqlTime As String _
) As DateTime
'Usage
Dim sqlTime As String
Dim returnValue As DateTime

returnValue = SPUtility.CreateDateTimeFromSqlString(sqlTime)
public static DateTime CreateDateTimeFromSqlString(
    string sqlTime
)

Parameters

  • sqlTime
    Type: System.String

    A string that contains date and time in SQL format.

Return Value

Type: System.DateTime
A System.DateTime object that provides the date and time.

See Also

Reference

SPUtility Class

SPUtility Members

Microsoft.SharePoint.Utilities Namespace