简单问题,请大家回答。

解决方案 »

  1.   

    DateTimePicker1.DateTime:=IncSecond(now,5);
    DateTimePicker2.DateTime:=IncSecond(now,-5);
      

  2.   

    Delphi中TDateTime和浮点数兼容,浮点数,1.0=1天,1.0/24=一小时,如此类推。
      

  3.   

    IncSecond function
    -------------------------------------------------------------------
    Returns a date/time value shifted by a specified number of seconds.UnitDateUtilsCategorydatetime routinesDelphi syntax:function IncSecond(const AValue: TDateTime; const ANumberOfSeconds: Int64 = 1): TDateTime;DescriptionIncSecond returns the value of the AValue parameter, incremented by ANumberOfSeconds seconds. ANumberOfSeconds can be negative, to return a date and time N seconds prior to AValue.