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
web
Type: Microsoft.SharePoint.SPWebAn Microsoft.SharePoint.SPWeb object that represents the site in which the date and time value is used.
stDate
Type: System.StringA string that contains the date.
stTime
Type: System.StringA string that contains the time.
bToUTC
Type: System.Booleantrue 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.