SPUtility.ParseDate method (SPWeb, String, SPDateFormat, Boolean)
從指定的字串,其中包含的日期與時間值,會建立System.DateTime物件。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
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
Type: Microsoft.SharePoint.SPWebMicrosoft.SharePoint.SPWeb物件表示的日期與時間值所使用的網站。
stDateTime
Type: System.String內含的日期和時間的字串。
format
Type: Microsoft.SharePoint.Utilities.SPDateFormatSPDateFormat列舉值,以決定的日期輸出格式。
bToUTC
Type: System.Boolean若要將資料與時間的字串轉換成 System.DateTime物件,以國際標準時間 (UTC) 時間 ; true 若要將字串轉換成以本地時間網站System.DateTime物件false 。
傳回值
Type: System.DateTime
System.DateTime物件,其中包含的日期和時間。