DateAndTime.Second(DateTime) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個從0到59的整數值,代表分鐘的第二秒。
public:
static int Second(DateTime TimeValue);
public static int Second(DateTime TimeValue);
static member Second : DateTime -> int
Public Function Second (TimeValue As DateTime) As Integer
參數
- TimeValue
- DateTime
必須的。 一個 Date 你想從中提取第二個的數值。
傳回
一個從0到59的整數值,代表一分鐘的第二秒。
範例
以下範例使用該 Second 函數,從指定時間取得分鐘的秒。 在開發環境中,時間字面值會以短時間格式顯示,使用程式碼的區域設定。
Dim thisTime As Date
Dim thisSecond As Integer
thisTime = #4:35:17 PM#
thisSecond = Second(thisTime)
' thisSecond now contains 17.
備註
你也可以透過呼叫 DatePart 並指定 DateInterval.Second 參數來 Interval 取得分鐘的第二秒。