当前时间减一小时,如何做,请高手指教

解决方案 »

  1.   

    ShowMessage(DateTimeToStr(IncHour(now,-1)) );
      

  2.   

    //自己写函数
    function IncHour(const AValue: TDateTime;
      const ANumberOfHours: Int64): TDateTime;
    begin
      Result := ((AValue * 24) + ANumberOfHours) / 24;
    end;
    ShowMessage(DateTimeToStr(IncHour(now,-1)) );
      

  3.   

    function IncHour(const AValue: TDateTime;
      const ANumberOfHours: Int64): TDateTime;
    begin
      Result := ((AValue * HoursPerDay) + ANumberOfHours) / HoursPerDay;
    end;procedure TForm1.Button1Click(Sender: TObject);begin
       showmessage( FormatDateTime('hh:mm:ss', IncHour(Now,-1)))
    end;