RSS匡堋 | 停兆誘後
艇議了崔利嫋遍匈 > 扮寂 > 屎猟

delphi IncYear、IncMonth、IncWeek、IncDay、IncHour、IncMinute、IncSecond、IncMilliSecond C 奐扮

恬宀admin 栖坿 晩豚2013/10/10 20:06:18 繁賑 炎禰

DateUtils.IncYear();
DateUtils.IncMonth();
DateUtils.IncWeek();
DateUtils.IncDay();
DateUtils.IncHour();
DateUtils.IncMinute();
DateUtils.IncSecond();
DateUtils.IncMilliSecond();

  unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls;type  TForm1 = class(TForm)    procedure FormCreate(Sender: TObject);  end;var  Form1: TForm1;implementation{$R *.dfm}uses DateUtils;procedure TForm1.FormCreate(Sender: TObject);var  t1,t2: TDateTime;  i: Int64;  d: Double;begin  t1 := StrToDateTime('2011-1-1 1:1:1');  t2 := IncYear(t1);  ShowMessage(DateTimeToStr(t2)); //2012-1-1 1:01:01  t2 := IncYear(t1, 3);  ShowMessage(DateTimeToStr(t2)); //2014-1-1 1:01:01  t2 := IncMonth(t1);  ShowMessage(DateTimeToStr(t2)); //2011-2-1 1:01:01  t2 := IncWeek(t1);  ShowMessage(DateTimeToStr(t2)); //2011-1-8 1:01:01  t2 := IncDay(t1);  ShowMessage(DateTimeToStr(t2)); //2011-1-2 1:01:01  t2 := IncHour(t1);  ShowMessage(DateTimeToStr(t2)); //2011-1-1 2:01:01  t2 := IncMinute(t1);  ShowMessage(DateTimeToStr(t2)); //2011-1-1 1:02:01  t2 := IncSecond(t1);  ShowMessage(DateTimeToStr(t2)); //2011-1-1 1:01:02  t2 := IncMilliSecond(t1);  ShowMessage(FormatDateTime('yyyy-m-d h:n:s:zzz', t2)); //2011-1-1 1:01:01:001end;end.

響頼宸鐙猟嫗朔艇伉秤泌採
0
0
0
0
0
0
0
0
云猟利峽