想使用comparetime函数比较时间,delphi的帮助上是说日期的大小是可以忽略的,
比如比较compareTime('2009-01-23 12:00:00','2009-01-01 13:00:00')
返回的应该是-1,
但是实际上为什么是1呢

解决方案 »

  1.   

    compareTime的帮助你看了吗,什么时候返回-1(A早于B)
    日期的大小是可以忽略的??此话怎讲
      

  2.   

    Call CompareTime to compare the two TDateTime values specified by A and B. CompareTime returns LessThanValue if A occurs earlier in the day than B (even if A occurs on a later day than B).
    EqualsValue if A occurs at the same time of day as B, ignoring of the date portion of the two values.
    GreaterThanValue if A occurs later in the day than B (even if A occurs on an earlier day than B).
    这不是么,难道我的理解有误?
      

  3.   

    LessThanValue if A is earlier than B.如果A小于B,返回值是LessThanValue,而LessThanValue对应值就是-1
    EqualsValue if A is the same as B.如果A等于B,返回值是EqualsValue,也就是0
    GreaterThanValue if A is later than B.如果A大于B,返回值是GreaterThanValue,也就是1