共用方式為


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
)

參數

  • stDateTime
    Type: System.String

    內含的日期和時間的字串。

  • 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