일 수 단위로 계산을 하실 때는..
Var
GapOfDates : Integer;
A, B : TDateTime;
Begin
...
GapOfDates:= Round(A-B);
End;
이렇게 하시고요..
월, 년 단위들은..
Go PDSPF.11에서 제가 올린 라이브러리를 받아보시면..
거기에 각종 함수들이 있습니다..
(양력/음력 변환 및 여러가지 날자 관련 함수 및
160가지 함수 모음, RyuLib.zip으로 올려져 있음)
From 류..
---------
Function DateTimeToDate(DateTime:TDateTime):TDate;
Function DateToDateTime(Date:TDate):TDateTime;
Function ToDate(Year,Month,Day:Integer):TDate;
Function EumToYaeng(Var S1,S2:TDate):Boolean;
Function YaengToEum(Var S1,S2:TDate):Boolean;
Function DayOfYear(Year:Integer):Integer;
Function DayOfMonth(Date:TDate):Integer;
Function WeekOftheDay(Date:TDate):TWeek;
Function GanJe(Year:Integer):String;
Function DayOfTwo(Y1,M1,D1,Y2,M2,D2:Integer):LongInt;
Procedure IncMonth(Var Date:TDate; Gap:Integer);
Procedure DecMonth(Var Date:TDate; Gap:Integer);
// TDateTime을 사용할 경우에는 DateTime:= DateTime + (or -) Gap
Procedure IncDay(Var Date:TDate; Gap:Integer);
Procedure DecDay(Var Date:TDate; Gap:Integer);
|