5,386
社区成员
发帖
与我相关
我的任务
分享
DateTimePicker1.Format:='yyyy-MM' ; DateTimePicker2.Date:=now; //获取当前时间,只显示年-月
另:
var
t:TDateTime;
ss:string
t:=Date()+Time();
ss:=datetimetostr(t); //时间转换为字符串形式
procedure TForm1.Button1Click(Sender: TObject);
var
DateValue : TDate;
TimeValue: TTime;
OutDateTime : TDateTime;
begin
DateValue:=Date;
TimeValue:=Time;
OutDateTime := Int(DateValue) + Frac(TimeValue);
ShowMessage(DateTimeToStr(OutDateTime));
end;
日期往后一天的实现方式
[code=Delphi(Pascal)]var tdate:TDateTime;
tdate:=StrToDateTime(‘2009-12-03’);
tdate:=tdate+1;
showmessage(DateTimeToStr(tdate));