DateTime.GreaterThan(DateTime, DateTime) DateTime.GreaterThan(DateTime, DateTime) DateTime.GreaterThan(DateTime, DateTime) DateTime.GreaterThan(DateTime, DateTime) Operator

定义

确定指定的 DateTime 是否晚于另一个指定的 DateTimeDetermines whether one specified DateTime is 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 later than t2; otherwise, false.

注解

@No__t-0 运算符通过比较两个 @no__t 值的计时周期数来确定这两个值之间的关系。The GreaterThan 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)

适用于

另请参阅