共用方式為


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

從指定的字串,其中包含的日期與時間值,會建立System.DateTime物件。

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Shared Function ParseDate ( _
    web As SPWeb, _
    stDate As String, _
    stTime As String, _
    bToUTC As Boolean _
) As DateTime
'用途
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
)

參數

  • bToUTC
    Type: System.Boolean

    若要將資料與時間的字串轉換成System.DateTime物件,以國際標準時間 (UTC) 時間 ; true若要將字串轉換成以本地時間網站System.DateTime物件false 。

傳回值

Type: System.DateTime
System.DateTime物件,其中包含的日期和時間。

請參閱

參照

SPUtility class

SPUtility members

ParseDate overload

Microsoft.SharePoint.Utilities namespace