当前时间减去生日得出的就是时间差。procedure TForm1.Button1Click(Sender: TObject);
var
a: TDateTime;
begin
a:=date-EncodeDate(1999,8,18);
showmessage(datetostr(a));
end;
var
a: TDateTime;
begin
a:=date-EncodeDate(1999,8,18);
showmessage(datetostr(a));
end;
解决方案 »
- Memo.lines问题
- 新手请问:怎样让一个Lable的text等于DBGrid(或者query)的某一列的值,就是说随着光标的移动,这个text也在变。
- 请问:如何打印TRichEdit的内容?
- WORD关闭时,怎么才能不保存修改?内已有代码。
- 这个procedure DataShow;加到哪,才能被其他的单元使用?????????
- 将记录插入数据库表中时,如何用程序检查、实现记录的唯一
- 如何将图片 存到oracle 数据库中?
- 求助,如何在程序中更新fastreport文件中的memo值
- ‘字体’繁死了,求助
- 用ADO控件通过ODBC连接EXCEL文件可以连通,但为什么dataset里看不到数据,应该如何正确设置呢?
- 谁知道*.BMP和*.JPG文件的格式?
- 汉字排序小问题——可是一直困扰我呀:(——用户不满意
a, b: TDateTime;
Yeara, Yearb, temp: Word;DecodeDate(a, Yeara, temp, temp);
DecodeDate(b, Yearb, temp, temp);
ShowMessage(IntToStr(a - b));
Iage:Integer;
BirthdayDate,TodayDate:TDateTime;
begin
ages:=StrToInt(copy(DateToStr(TodayDate),1,4))-
StrToInt(copy(DateToStr(BirthdayDate),1,4));
end;