Compartilhar via


SPUtility.ParseDate Method (SPWeb, String, String, Boolean)

Creates a System.DateTime object from the specified strings containing date and time values.

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 ParseDate ( _
    web As SPWeb, _
    stDate As String, _
    stTime As String, _
    bToUTC As Boolean _
) As DateTime
'Usage
Dim web As SPWeb
Dim stDate As String
Dim stTime As String
Dim bToUTC As Boolean
Dim returnValue As DateTime

returnValue = SPUtility.ParseDate(web, _
    stDate, stTime, bToUTC)
public static DateTime ParseDate(
    SPWeb web,
    string stDate,
    string stTime,
    bool bToUTC
)

Parameters

  • bToUTC
    Type: System.Boolean

    true to convert data and time strings into a System.DateTime object in Coordinated Universal Time (UTC) time; false to convert the strings into a System.DateTime object in local time for the site.

Return Value

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

See Also

Reference

SPUtility Class

SPUtility Members

ParseDate Overload

Microsoft.SharePoint.Utilities Namespace