Returns a date shifted by a specified number of days.UnitDateUtilsCategorydatetime routinesDelphi syntax:function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer = 1): TDateTime;C++ syntax:extern PACKAGE System::TDateTime __fastcall IncDay(const System::TDateTime AValue, const int ANumberOfDays = 0x1);DescriptionIncDay returns the value of the AValue parameter, incremented by ANumberOfDays days. ANumberOfDays can be negative, to return a date N days previous.The time of day specified by the AValue parameter is copied to the result. ------------------------------------ 体验速度,体验CSDN新版论坛助手:http://community.csdn.net/Expert/TopicView.asp?id=3108679
function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer = 1): TDateTime;
function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer = 1): TDateTime;
//月初 function BOFM(Date1:TDateTime):TDateTime; var Year1,Month1,Day1:Word; begin DecodeDate(Date1,Year1,Month1,Day1); Result := EncodeDate(Year1,Month1,1); end;//月末 function EOFM(Date1:TDateTime):TDateTime; var Year1,Month1,Day1:word; begin DecodeDate(Date1, Year1, Month1, Day1); Result := EncodeDate(Year1,Month1,DayOfTheMonth(Date1)); end;
------------------------------------
体验速度,体验CSDN新版论坛助手:http://community.csdn.net/Expert/TopicView.asp?id=3108679
function BOFM(Date1:TDateTime):TDateTime;
var
Year1,Month1,Day1:Word;
begin
DecodeDate(Date1,Year1,Month1,Day1);
Result := EncodeDate(Year1,Month1,1);
end;//月末
function EOFM(Date1:TDateTime):TDateTime;
var
Year1,Month1,Day1:word;
begin
DecodeDate(Date1, Year1, Month1, Day1);
Result := EncodeDate(Year1,Month1,DayOfTheMonth(Date1));
end;
t: TDate;
begin
t := t+1;
end;