DateTime.GreaterThanOrEqual(DateTime, DateTime) DateTime.GreaterThanOrEqual(DateTime, DateTime) DateTime.GreaterThanOrEqual(DateTime, DateTime) DateTime.GreaterThanOrEqual(DateTime, DateTime) Operator

定义

确定一个指定的 DateTime 表示的日期和时间等于还是晚于另一个指定的 DateTimeDetermines whether one specified DateTime represents a date and time that is the same as or later than another specified 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 DateTime DateTime DateTime

要比较的第一个对象。The first object to compare.

t2
DateTime DateTime DateTime DateTime

要比较的第二个对象。The second object to compare.

返回

如果 true 等于或晚于 t1,则为 t2;否则为 falsetrue if t1 is the same as or later than t2; otherwise, false.

注解

运算符通过比较两个值的DateTime计时周期数来确定这两个值之间的关系。 GreaterThanOrEqualThe GreaterThanOrEqual operator determines the relationship between two DateTime values by comparing their number of ticks. 在比较DateTime对象之前, 请确保对象表示相同时区中的时间。Before comparing DateTime objects, make sure that the objects represent times in the same time zone. 可以通过比较其 Kind 属性的值来执行此操作。You can do this by comparing the values of their Kind property.

此运算符的等效方法是DateTime.Compare(DateTime, DateTime)The equivalent method for this operator is DateTime.Compare(DateTime, DateTime)

适用于

另请参阅