DateTime.LessThan(DateTime, DateTime) 演算子

定義

指定した DateTime が、指定したもう 1 つの DateTime より前の時刻かどうかを判断します。

public:
 static bool operator <(DateTime t1, DateTime t2);
public static bool operator < (DateTime t1, DateTime t2);
static member ( < ) : DateTime * DateTime -> bool
Public Shared Operator < (t1 As DateTime, t2 As DateTime) As Boolean

パラメーター

t1
DateTime

比較する最初のオブジェクト。

t2
DateTime

比較する 2 番目のオブジェクト。

戻り値

truet1 より早い場合は t2。それ以外の場合は false

注釈

演算子は LessThan 、ティック数を比較することによって、2 つの DateTime 値間のリレーションシップを決定します。 オブジェクトを比較する DateTime 前に、オブジェクトが同じタイム ゾーンの時刻を表していることを確認します。 これを行うには、Kind プロパティの値を比較します。

この演算子の同等のメソッドは 次のようになります。 DateTime.Compare(DateTime, DateTime)

適用対象

こちらもご覧ください