DateAndTime.Second(DateTime) メソッド

定義

分の 2 番目を表す 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

必須。 2 番目の値を抽出する Date 値。

返品

分の秒を表す 0 ~ 59 の整数値。

次の例では、 Second 関数を使用して、指定した時刻から 2 番目の分を取得します。 開発環境では、時間リテラルはコードのロケール設定を使用して短い時刻形式で表示されます。

Dim thisTime As Date
Dim thisSecond As Integer
thisTime = #4:35:17 PM#
thisSecond = Second(thisTime)
' thisSecond now contains 17.

注釈

DatePartを呼び出し、DateInterval.Second引数にIntervalを指定することで、分の 2 番目を取得することもできます。

適用対象

こちらもご覧ください