dati.inc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. {
  2. *********************************************************************
  3. $Id$
  4. Copyright (C) 1997, 1998 Gertjan Schouten
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. *********************************************************************
  17. System Utilities For Free Pascal
  18. }
  19. {==============================================================================}
  20. { internal functions }
  21. {==============================================================================}
  22. const
  23. DayTable: array[Boolean, 1..12] of longint =
  24. ((0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),
  25. (0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335));
  26. function DoEncodeDate(Year, Month, Day: Word): longint;
  27. var i: longint;
  28. begin
  29. Result := 0;
  30. if (Year >= 1) and (Year <= 9999) and (Month >= 1) and (Month <= 12) and
  31. (Day >= 1) and (Day <= 31) then begin
  32. Day := Day + DayTable[IsLeapYear(Year), Month] - 1;
  33. I := Year - 1;
  34. result := I * 365 + I div 4 - I div 100 + I div 400 + Day - DateDelta;
  35. end ;
  36. end ;
  37. function DoEncodeTime(Hour, Minute, Second, MilliSecond: word): longint;
  38. begin
  39. If ((hour>=0) and (Hour<24)) and
  40. ((Minute>=0) and (Minute<60)) and
  41. ((Second>=0) and (Second<60)) and
  42. ((MilliSecond>=0) and (Millisecond<1000)) then
  43. Result := (Hour * 3600000 + Minute * 60000 + Second * 1000 + MilliSecond)
  44. else
  45. Result:=0;
  46. end ;
  47. {==============================================================================}
  48. { Public functions }
  49. {==============================================================================}
  50. { DateTimeToTimeStamp converts DateTime to a TTimeStamp }
  51. function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
  52. begin
  53. result.Time := Trunc(Frac(DateTime) * MSecsPerDay);
  54. result.Date := 1
  55. + DateDelta
  56. + Trunc(System.Int(DateTime));
  57. end ;
  58. { TimeStampToDateTime converts TimeStamp to a TDateTime value }
  59. function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;
  60. begin
  61. result := (TimeStamp.Date - DateDelta - 1) + (TimeStamp.Time / MSecsPerDay);
  62. end ;
  63. { MSecsToTimeStamp }
  64. function MSecsToTimeStamp(MSecs: comp): TTimeStamp;
  65. begin
  66. result.Date := trunc(msecs / msecsperday);
  67. msecs:= msecs - comp(result.date * msecsperday);
  68. result.Time := Trunc(MSecs);
  69. end ;
  70. { TimeStampToMSecs }
  71. function TimeStampToMSecs(const TimeStamp: TTimeStamp): comp;
  72. begin
  73. result := TimeStamp.Time + timestamp.date*msecsperday;
  74. end ;
  75. { EncodeDate packs three variables Year, Month and Day into a
  76. TDateTime value the result is the number of days since 12/30/1899 }
  77. function EncodeDate(Year, Month, Day: word): TDateTime;
  78. begin
  79. result := DoEncodeDate(Year, Month, Day);
  80. end ;
  81. { EncodeTime packs four variables Hour, Minute, Second and MilliSecond into
  82. a TDateTime value }
  83. function EncodeTime(Hour, Minute, Second, MilliSecond:word):TDateTime;
  84. begin
  85. Result := DoEncodeTime(hour, minute, second, millisecond) / MSecsPerDay;
  86. end ;
  87. { DecodeDate unpacks the value Date into three values:
  88. Year, Month and Day }
  89. procedure DecodeDate(Date: TDateTime; var Year, Month, Day: word);
  90. const
  91. D1 = 365; { number of days in 1 year }
  92. D4 = D1 * 4 + 1; { number of days in 4 years }
  93. D100 = D4 * 25 - 1; { number of days in 100 years }
  94. D400 = D100 * 4 + 1; { number of days in 400 years }
  95. var
  96. l:longint;
  97. ly:boolean;
  98. begin
  99. l := Trunc(System.Int(Date)) + DateDelta;
  100. year := 1 + 400 * (l div D400); l := (l mod D400);
  101. year := year + 100 * (l div D100);l := (l mod D100);
  102. year := year + 4 * (l div D4);l := (l mod D4);
  103. year := year + (l div D1);l := 1 + (l mod D1);
  104. month := 0;
  105. ly := IsLeapYear(Year);
  106. while (month < 12) and (l > DayTable[ly, month + 1]) do
  107. inc(month);
  108. day := l - DayTable[ly, month];
  109. end ;
  110. { DecodeTime unpacks Time into four values:
  111. Hour, Minute, Second and MilliSecond }
  112. procedure DecodeTime(Time: TDateTime; var Hour, Minute, Second, MilliSecond: word);
  113. begin
  114. { l := Trunc(Frac(time) * MSecsPerDay);
  115. Hour := l div 3600000;l := l mod 3600000;
  116. Minute := l div 60000;l := l mod 60000;
  117. Second := l div 1000;l := l mod 1000;
  118. MilliSecond := l;
  119. }
  120. Time := Frac(Time) * 24;
  121. Hour := Trunc(Time);
  122. Time := Frac(Time) * 60;
  123. Minute := Trunc(Time);
  124. Time := Frac(Time) * 60;
  125. Second := Trunc(Time);
  126. MilliSecond := Trunc(Frac(Time) * 1000);
  127. end;
  128. { DateTimeToSystemTime converts DateTime value to SystemTime }
  129. procedure DateTimeToSystemTime(DateTime: TDateTime; var SystemTime: TSystemTime);
  130. begin
  131. DecodeDate(DateTime, SystemTime.Year, SystemTime.Month, SystemTime.Day);
  132. DecodeTime(DateTime, SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.MilliSecond);
  133. end ;
  134. { SystemTimeToDateTime converts SystemTime to a TDateTime value }
  135. function SystemTimeToDateTime(const SystemTime: TSystemTime): TDateTime;
  136. begin
  137. result := DoEncodeDate(SystemTime.Year,
  138. SystemTime.Month,
  139. SystemTime.Day) +
  140. DoEncodeTime(SystemTime.Hour,
  141. SystemTime.Minute,
  142. SystemTime.Second,
  143. SystemTime.MilliSecond) / MSecsPerDay;
  144. end ;
  145. { DayOfWeek returns the Day of the week (sunday is day 1) }
  146. function DayOfWeek(DateTime: TDateTime): integer;
  147. begin
  148. Result := 1 + (Trunc(DateTime) mod 7);
  149. end ;
  150. { Date returns the current Date }
  151. function Date: TDateTime;
  152. var SystemTime: TSystemTime;
  153. begin
  154. GetLocalTime(SystemTime);
  155. result := DoEncodeDate(SystemTime.Year,
  156. SystemTime.Month,
  157. SystemTime.Day);
  158. end ;
  159. { Time returns the current Time }
  160. function Time: TDateTime;
  161. var SystemTime: TSystemTime;
  162. begin
  163. GetLocalTime(SystemTime);
  164. Result := DoEncodeTime(SystemTime.Hour,
  165. SystemTime.Minute,
  166. SystemTime.Second,
  167. SystemTime.MilliSecond) / MSecsPerDay;
  168. end ;
  169. { Now returns the current Date and Time }
  170. function Now: TDateTime;
  171. var SystemTime: TSystemTime;
  172. begin
  173. GetLocalTime(SystemTime);
  174. result := DoEncodeDate(SystemTime.Year,
  175. SystemTime.Month,
  176. SystemTime.Day) +
  177. DoEncodeTime(SystemTime.Hour,
  178. SystemTime.Minute,
  179. SystemTime.Second,
  180. SystemTime.MilliSecond) / MSecsPerDay;
  181. end ;
  182. { IncMonth increments DateTime with NumberOfMonths months,
  183. NumberOfMonths can be less than zero }
  184. function IncMonth(const DateTime: TDateTime; NumberOfMonths: integer): TDateTime;
  185. var Year, Month, Day: word;
  186. S : Integer;
  187. begin
  188. If NumberOfMonths>=0 then s:=1 else s:=-1;
  189. DecodeDate(DateTime, Year, Month, Day);
  190. Year := Year + (NumberOfMonths div 12);
  191. Month := Month + (NumberOfMonths mod 12)-1 ; // Mod result always positive
  192. if Month>11 then begin
  193. Dec(Month, S*12);
  194. Inc(Year, S);
  195. end ;
  196. Inc(Month, 1); { Months from 1 to 12 }
  197. if (Month = 2) and (IsLeapYear(Year)) and (Day > 28) then
  198. Day := 28;
  199. result := Frac(DateTime) + DoEncodeDate(Year, Month, Day);
  200. end ;
  201. { IsLeapYear returns true if Year is a leap year }
  202. function IsLeapYear(Year: Word): boolean;
  203. begin
  204. Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));
  205. end;
  206. { DateToStr returns a string representation of Date using ShortDateFormat }
  207. function DateToStr(Date: TDateTime): string;
  208. begin
  209. result := FormatDateTime('ddddd', Date);
  210. end ;
  211. { TimeToStr returns a string representation of Time using ShortTimeFormat }
  212. function TimeToStr(Time: TDateTime): string;
  213. begin
  214. result := FormatDateTime('t', Time);
  215. end ;
  216. { DateTimeToStr returns a string representation of DateTime using ShortDateTimeFormat }
  217. function DateTimeToStr(DateTime: TDateTime): string;
  218. begin
  219. result := FormatDateTime('c', DateTime);
  220. end ;
  221. { StrToDate converts the string S to a TDateTime value
  222. if S does not represent a valid date value
  223. an EConvertError will be raised }
  224. function StrToDate(const S: string): TDateTime;
  225. var
  226. df:string;
  227. d,m,y:word;
  228. n,i:longint;
  229. c:word;
  230. dp,mp,yp,which : Byte;
  231. s1:string[4];
  232. values:array[0..2] of longint;
  233. LocalTime:tsystemtime;
  234. begin
  235. df := UpperCase(ShortDateFormat);
  236. { Determine order of D,M,Y }
  237. Which:=0;
  238. For I:=1 to Length(df) do
  239. Case df[i] of
  240. 'Y' : yp:=which;
  241. 'M' : mp:=which;
  242. 'D' : dp:=which;
  243. else
  244. If df[i]=DateSeparator then
  245. Inc(Which);
  246. end;
  247. { Get actual values }
  248. for i := 0 to 2 do values[i] := 0;
  249. s1 := '';
  250. n := 0;
  251. for i := 1 to length(s) do begin
  252. if (s[i] in ['0'..'9']) then s1 := s1 + s[i];
  253. if (s[i] in [dateseparator,' ']) or (i = length(s)) then begin
  254. val(s1, values[n], c);
  255. if c<>0 then
  256. Raise EConvertError.Create('Invalid date format');
  257. s1 := '';
  258. inc(n);
  259. end ;
  260. end ;
  261. // Fill in values.
  262. If N=3 then
  263. begin
  264. y:=values[yp];
  265. m:=values[mp];
  266. d:=values[dp];
  267. end
  268. Else
  269. begin
  270. getLocalTime(LocalTime);
  271. y := LocalTime.Year;
  272. If n<2 then
  273. begin
  274. d:=values[0];
  275. m := LocalTime.Month;
  276. end
  277. else
  278. If dp<mp then
  279. begin
  280. d:=values[0];
  281. m:=values[1];
  282. end
  283. else
  284. begin
  285. d:=values[1];
  286. m:=values[0];
  287. end;
  288. end;
  289. if (y >= 0) and (y < 100) then y := 1900 + y;
  290. Result := DoEncodeDate(y, m, d);
  291. end ;
  292. { StrToTime converts the string S to a TDateTime value
  293. if S does not represent a valid time value an
  294. EConvertError will be raised }
  295. function StrToTime(const s: string): TDateTime;
  296. var
  297. Len, Current: integer; PM: boolean;
  298. function GetElement: integer;
  299. var
  300. j: integer; c: word;
  301. begin
  302. result := -1;
  303. Inc(Current);
  304. while (result = -1) and (Current < Len) do begin
  305. if S[Current] in ['0'..'9'] then begin
  306. j := Current;
  307. while (Current < Len) and (s[Current + 1] in ['0'..'9']) do
  308. Inc(Current);
  309. val(copy(S, j, 1 + Current - j), result, c);
  310. end
  311. else if (S[Current] = TimeAMString[1]) or (S[Current] in ['a', 'A']) then begin
  312. Current := 1 + Len;
  313. end
  314. else if (S[Current] = TimePMString[1]) or (S[Current] in ['p', 'P']) then begin
  315. Current := 1 + Len;
  316. PM := True;
  317. end
  318. else if (S[Current] = TimeSeparator) or (S[Current] = ' ') then
  319. Inc(Current)
  320. else
  321. raise EConvertError.Create('Invalid Time format');
  322. end ;
  323. end ;
  324. var
  325. i: integer;
  326. TimeValues: array[0..4] of integer;
  327. begin
  328. Current := 0;
  329. Len := length(s);
  330. PM := False;
  331. for i:=0 to 4 do
  332. timevalues[i]:=0;
  333. i := 0;
  334. TimeValues[i] := GetElement;
  335. while (i < 5) and (TimeValues[i] <> -1) do begin
  336. i := i + 1;
  337. TimeValues[i] := GetElement;
  338. end ;
  339. If (i<5) and (TimeValues[I]=-1) then
  340. TimeValues[I]:=0;
  341. if PM then Inc(TimeValues[0], 12);
  342. result := EncodeTime(TimeValues[0], TimeValues[1], TimeValues[2], TimeValues[3]);
  343. end ;
  344. { StrToDateTime converts the string S to a TDateTime value
  345. if S does not represent a valid date and time value
  346. an EConvertError will be raised }
  347. function StrToDateTime(const s: string): TDateTime;
  348. var i: integer;
  349. begin
  350. i := pos(' ', s);
  351. if i > 0 then result := StrToDate(Copy(S, 1, i - 1)) + StrToTime(Copy(S, i + 1, length(S)))
  352. else result := StrToDate(S);
  353. end ;
  354. { FormatDateTime formats DateTime to the given format string FormatStr }
  355. function FormatDateTime(FormatStr: string; DateTime: TDateTime): string;
  356. var
  357. ResultLen: integer;
  358. ResultBuffer: array[0..255] of char;
  359. ResultCurrent: pchar;
  360. procedure StoreStr(Str: pchar; Len: integer);
  361. begin
  362. if ResultLen + Len < SizeOf(ResultBuffer) then begin
  363. StrMove(ResultCurrent, Str, Len);
  364. ResultCurrent := ResultCurrent + Len;
  365. ResultLen := ResultLen + Len;
  366. end ;
  367. end ;
  368. procedure StoreString(const Str: string);
  369. var Len: integer;
  370. begin
  371. Len := Length(Str);
  372. if ResultLen + Len < SizeOf(ResultBuffer) then begin
  373. StrMove(ResultCurrent, pchar(Str), Len);
  374. ResultCurrent := ResultCurrent + Len;
  375. ResultLen := ResultLen + Len;
  376. end;
  377. end;
  378. procedure StoreInt(Value, Digits: integer);
  379. var S: string; Len: integer;
  380. begin
  381. S := IntToStr(Value);
  382. Len := Length(S);
  383. if Len < Digits then begin
  384. S := copy('0000', 1, Digits - Len) + S;
  385. Len := Digits;
  386. end ;
  387. StoreStr(pchar(@S[1]), Len);
  388. end ;
  389. var
  390. Year, Month, Day, DayOfWeek, Hour, Minute, Second, MilliSecond: word;
  391. procedure StoreFormat(const FormatStr: string);
  392. var
  393. Token: char;
  394. FormatCurrent: pchar;
  395. FormatEnd: pchar;
  396. Count: integer;
  397. Clock12: boolean;
  398. P: pchar;
  399. begin
  400. FormatCurrent := Pchar(FormatStr);
  401. FormatEnd := FormatCurrent + Length(FormatStr);
  402. Clock12 := false;
  403. P := FormatCurrent;
  404. while P < FormatEnd do begin
  405. Token := UpCase(P^);
  406. if Token in ['"', ''''] then begin
  407. P := P + 1;
  408. while (P < FormatEnd) and (P^ <> Token) do
  409. P := P + 1;
  410. end
  411. else if Token = 'A' then begin
  412. if (StrLIComp(P, 'A/P', 3) = 0) or
  413. (StrLIComp(P, 'AMPM', 4) = 0) or
  414. (StrLIComp(P, 'AM/PM', 5) = 0) then begin
  415. Clock12 := true;
  416. break;
  417. end ;
  418. end ;
  419. P := P + 1;
  420. end ;
  421. while FormatCurrent < FormatEnd do begin
  422. Token := UpCase(FormatCurrent^);
  423. Count := 1;
  424. P := FormatCurrent + 1;
  425. case Token of
  426. '''', '"': begin
  427. while (P < FormatEnd) and (p^ <> Token) do
  428. P := P + 1;
  429. P := P + 1;
  430. Count := P - FormatCurrent;
  431. StoreStr(FormatCurrent + 1, Count - 2);
  432. end ;
  433. 'A': begin
  434. if StrLIComp(FormatCurrent, 'AMPM', 4) = 0 then begin
  435. Count := 4;
  436. if Hour < 12 then StoreString(TimeAMString)
  437. else StoreString(TimePMString);
  438. end
  439. else if StrLIComp(FormatCurrent, 'AM/PM', 5) = 0 then begin
  440. Count := 5;
  441. if Hour < 12 then StoreStr('am', 2)
  442. else StoreStr('pm', 2);
  443. end
  444. else if StrLIComp(FormatCurrent, 'A/P', 3) = 0 then begin
  445. Count := 3;
  446. if Hour < 12 then StoreStr('a', 1)
  447. else StoreStr('p', 1);
  448. end
  449. else
  450. Raise EConvertError.Create('Illegal character in format string');
  451. end ;
  452. '/': StoreStr(@DateSeparator, 1);
  453. ':': StoreStr(@TimeSeparator, 1);
  454. ' ', 'C', 'D', 'H', 'M', 'N', 'S', 'T', 'Y': begin
  455. while (P < FormatEnd) and (UpCase(P^) = Token) do
  456. P := P + 1;
  457. Count := P - FormatCurrent;
  458. case Token of
  459. ' ': StoreStr(FormatCurrent, Count);
  460. 'Y': begin
  461. case Count of
  462. 1: StoreInt(Year, 0);
  463. 2: StoreInt(Year mod 100, 2);
  464. 4: StoreInt(Year, 4);
  465. end ;
  466. end ;
  467. 'M': begin
  468. case Count of
  469. 1: StoreInt(Month, 0);
  470. 2: StoreInt(Month, 2);
  471. 3: StoreString(ShortMonthNames[Month]);
  472. 4: StoreString(LongMonthNames[Month]);
  473. end ;
  474. end ;
  475. 'D': begin
  476. case Count of
  477. 1: StoreInt(Day, 0);
  478. 2: StoreInt(Day, 2);
  479. 3: StoreString(ShortDayNames[DayOfWeek]);
  480. 4: StoreString(LongDayNames[DayOfWeek]);
  481. 5: StoreFormat(ShortDateFormat);
  482. 6: StoreFormat(LongDateFormat);
  483. end ;
  484. end ;
  485. 'H': begin
  486. if Clock12 then begin
  487. if Count = 1 then StoreInt(Hour mod 12, 0)
  488. else StoreInt(Hour mod 12, 2);
  489. end
  490. else begin
  491. if Count = 1 then StoreInt(Hour, 0)
  492. else StoreInt(Hour, 2);
  493. end ;
  494. end ;
  495. 'N': begin
  496. if Count = 1 then StoreInt(Minute, 0)
  497. else StoreInt(Minute, 2);
  498. end ;
  499. 'S': begin
  500. if Count = 1 then StoreInt(Second, 0)
  501. else StoreInt(Second, 2);
  502. end ;
  503. 'T': begin
  504. if Count = 1 then StoreFormat(ShortTimeFormat)
  505. else StoreFormat(LongTimeFormat);
  506. end ;
  507. 'C': StoreFormat(ShortDateFormat + ' ' + ShortTimeFormat);
  508. end ;
  509. end ;
  510. else
  511. Raise EConvertError.Create('Illegal character in format string');
  512. end ;
  513. FormatCurrent := FormatCurrent + Count;
  514. end ;
  515. end ;
  516. begin
  517. DecodeDate(DateTime, Year, Month, Day);
  518. DecodeTime(DateTime, Hour, Minute, Second, MilliSecond);
  519. DayOfWeek := SysUtils.DayOfWeek(DateTime);
  520. ResultLen := 0;
  521. ResultCurrent := @ResultBuffer;
  522. StoreFormat(FormatStr);
  523. ResultBuffer[ResultLen] := #0;
  524. result := StrPas(@ResultBuffer);
  525. end ;
  526. { DateTimeToString formats DateTime to the given format in FormatStr }
  527. procedure DateTimeToString(var Result: string; const FormatStr: string; const DateTime: TDateTime);
  528. begin
  529. Result := FormatDateTime(FormatStr, DateTime);
  530. end ;
  531. Function DateTimeToFileDate(DateTime : TDateTime) : Longint;
  532. Var YY,MM,DD,H,m,s,msec : Word;
  533. begin
  534. Decodedate (DateTime,YY,MM,DD);
  535. If (YY<1980) or (YY>2099) then
  536. Result:=0
  537. else
  538. begin
  539. DecodeTime (DateTime,h,m,s,msec);
  540. Result:=(s shr 1) or (m shl 5) or (h shl 11);
  541. Result:=Result or DD shl 16 or (MM shl 21) or ((YY-1980) shl 25);
  542. end;
  543. end;
  544. Function FileDateToDateTime (Filedate : Longint) : TDateTime;
  545. Var Date,Time : Word;
  546. begin
  547. Date:=FileDate shl 16;
  548. Time:=FileDate and $ffff;
  549. Result:=EncodeDate((Date shr 9) + 1980,(Date shr 5) and 15, Date and 31) +
  550. EncodeTime(Time shr 11, (Time shr 5) and 63, (Time and 31) shl 1,0);
  551. end;
  552. {
  553. $Log$
  554. Revision 1.13 1999-05-31 20:50:44 peter
  555. * removed warnings
  556. Revision 1.12 1999/05/13 21:51:41 michael
  557. * several fixes
  558. Revision 1.11 1999/05/11 09:05:13 michael
  559. * SMall fixes to date/time routines
  560. Revision 1.10 1999/04/18 19:03:03 michael
  561. + Now EConvertError is used everywhere in conversions
  562. Revision 1.9 1999/04/08 11:31:02 peter
  563. * removed warnings
  564. Revision 1.8 1999/02/24 15:56:28 michael
  565. + Small fixes. Moved getlocaltime to system-dependent files
  566. Revision 1.7 1999/02/10 22:15:10 michael
  567. + Changed to ansistrings
  568. Revision 1.6 1999/02/09 12:38:42 michael
  569. * Fixed INt() proble. Defined THandle, included Filemode constants
  570. Revision 1.5 1998/10/15 09:39:12 michael
  571. Changes from Gretjan Schouten
  572. Revision 1.4 1998/10/11 13:40:52 michael
  573. + Added Conversion TDateTime <-> file date and time
  574. Revision 1.3 1998/09/16 08:28:36 michael
  575. Update from gertjan Schouten, plus small fix for linux
  576. Revision 1.1 1998/04/10 15:17:46 michael
  577. + Initial implementation; Donated by Gertjan Schouten
  578. His file was split into several files, to keep it a little bit structured.
  579. 1998/08/25 Gertjan
  580. + uses Go32 instead of Dos unit
  581. GetLocalTime
  582. DayOfWeek
  583. DoDecodeDate
  584. DoEncodeDate
  585. FormatDateTime
  586. }