Advertisement
believe_me

Untitled

May 18th, 2022
2,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function dateArrayToString(var DateOfPayArray: TDateOfPay): string;
  2. begin
  3.     Result := copy(DateOfPayArray, 1, 2) + '.' + copy(DateOfPayArray, 3, 2) + '.' + copy(DateOfPayArray, 5, 4);
  4. end;
  5.  
  6. function dateToNumber(var DateOfPayArray: TDateOfPay): TNumberOfdays;
  7. var
  8.     NumberOfDaysLeft: integer;
  9.     WritenTime, NowTime: TDateTime;
  10.     StringTime: string;
  11.     Difference: TNumberOfDays;
  12.     DayDifferece: TNumberOfDays;
  13.     ComparisonResult: integer;
  14. begin
  15.     StringTime := dateArrayToString(DateOfPayArray);
  16.     WritenTime := strToDate(StringTime);
  17.     NowTime := Now();
  18.     ComparisonResult := compareDate(WritenTime, NowTime);
  19.     DayDifferece := daysBetween(WritenTime, NowTime);
  20.     Difference := DayDifferece * ComparisonResult;
  21.     Result := Difference;
  22. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement