从指定的字符串包含日期和时间值创建System.DateTime对象。
命名空间: Microsoft.SharePoint.Utilities
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Shared Function ParseDate ( _
web As SPWeb, _
stDateTime As String, _
format As SPDateFormat, _
bToUTC As Boolean _
) As DateTime
用法
Dim web As SPWeb
Dim stDateTime As String
Dim format As SPDateFormat
Dim bToUTC As Boolean
Dim returnValue As DateTime
returnValue = SPUtility.ParseDate(web, _
stDateTime, format, bToUTC)
public static DateTime ParseDate(
SPWeb web,
string stDateTime,
SPDateFormat format,
bool bToUTC
)
参数
web
类型:Microsoft.SharePoint.SPWebMicrosoft.SharePoint.SPWeb对象表示该网站使用的日期和时间值。
stDateTime
类型:System.String一个字符串,包含日期和时间。
format
类型:Microsoft.SharePoint.Utilities.SPDateFormat确定的日期输出格式SPDateFormat枚举值。
bToUTC
类型:System.Booleantrue 以协调世界时 (UTC) 时间 ; 将日期和时间的字符串转换为 System.DateTime对象false ,以将字符串转换为本地时间的网站中的System.DateTime对象。
返回值
类型:System.DateTime
一个包含日期和时间的System.DateTime对象。