home *** CD-ROM | disk | FTP | other *** search
- unit Datebox;
-
- interface
-
- const
- Months: array[1..12] of string =
- ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
-
- function FormatDate(Temp: string; DateType: Integer): string;
-
- implementation
- uses
- MathBox,
- StrBox, SysUtils;
-
- function FormatDate(Temp: string; DateType: Integer): string;
- var
- Day, Month, MonthTemp, Year: string;
- i: Integer;
- begin
- Day := Shorten(Temp, 7);
- MonthTemp[0] := #3;
- Move(Temp[4], MonthTemp[1], 3);
- for i := 1 to 12 do
- if MonthTemp = Months[i] then
- Month := Int2StrPad0(i, 2);
- Year[0] := #2;
- Move(Temp[8], Year[1], 2);
- Result := Month + DateSeparator + Day + DateSeparator + Year;
- end;
-
- end.
-