1,如果获得7天前的Tdatetime时间对象?2,如何获得上个月26号的Tdatetime时间对象?
解决方案 »
- delphi dbgrideh导入excel 中
- 有谁知道用DELPHI通过ADO访问MS SQL数据库的编程实例。
- 求救,Qreport控件问题?
- Delphi中写了一个Service Application运行后在控制面板的服务里找不到??
- 为什么我用webbrowser打开flash会Could not obtain Ole control window handle
- 小问题!100分!
- 关于Tupdatesql的问题
- case 语句的问题?
- 有关dbgrideh查找时的问题
- 背景声音怎么处理
- WebBrowser怎么知道ajax执行完了呢?
- 找不到成员。InterFace not supported
var
dt1,dt2: TDateTime;
y,m,d: Word;
begin
dt1 := Trunc(now) - 7;
ShowMessage(FormatDateTime('YYYY-MM-DD HH:NN:SS',dt1));
dt2 := StartOfTheMonth(now);
DecodeDate(dt2,y,m,d);
while (d<>26) do
begin
dt2 := dt2 - 1;
DecodeDate(dt2,y,m,d);
end;
ShowMessage(FormatDateTime('YYYY-MM-DD HH:NN:SS',dt2));
end;
D:TDateTime;1. D:=Date-7;
2. if monthof(date)=1 then
D:=EncodeDate(yearof(date)-1,12,26)
else
D:=EncodeDate(yearof(date),monthof(date)-1,26);
RecodeDay(IncMonth(now,-1),29);