diff --git a/ide/aboutfrm.pas b/ide/aboutfrm.pas index ec082bddb1..591d1cd7ef 100644 --- a/ide/aboutfrm.pas +++ b/ide/aboutfrm.pas @@ -25,8 +25,8 @@ unit AboutFrm; interface uses - Classes, SysUtils, Forms, Controls, Graphics, Dialogs, LResources, StdCtrls, - Buttons, LazConf, LazarusIDEStrConsts; + Classes, SysUtils, FPCAdds, Forms, Controls, Graphics, Dialogs, LResources, + StdCtrls, Buttons, LazConf, LazarusIDEStrConsts; type TAboutForm = class(TForm) @@ -71,15 +71,15 @@ constructor TAboutForm.Create(AOwner: TComponent); var BuildDate: string; SlashPos1, SlashPos2: integer; - Date: TDate; + Date: TDateTime; begin BuildDate := {$I %date%}; SlashPos1 := Pos('/',BuildDate); SlashPos2 := SlashPos1 + Pos('/', Copy(BuildDate, SlashPos1+1, Length(BuildDate)-SlashPos1)); - Date := EncodeDate(StrToInt(Copy(BuildDate,1,SlashPos1-1)), - StrToInt(Copy(BuildDate,SlashPos1+1,SlashPos2-SlashPos1-1)), - StrToInt(Copy(BuildDate,SlashPos2+1,Length(BuildDate)-SlashPos2))); + Date := EncodeDate(StrToWord(Copy(BuildDate,1,SlashPos1-1)), + StrToWord(Copy(BuildDate,SlashPos1+1,SlashPos2-SlashPos1-1)), + StrToWord(Copy(BuildDate,SlashPos2+1,Length(BuildDate)-SlashPos2))); Result := DateTimeToStr(Date); end; begin diff --git a/lcl/fpcadds.pas b/lcl/fpcadds.pas index 6df14edd0a..a1d494a940 100644 --- a/lcl/fpcadds.pas +++ b/lcl/fpcadds.pas @@ -37,8 +37,22 @@ type {$IFDEF VER1_0} PCardinal = ^Cardinal; {$ENDIF} + +function StrToWord(const s: string): word; implementation +function StrToWord(const s: string): word; +var + p: Integer; +begin + Result:=0; + p:=1; + while (p<=length(s)) do begin + Result:=Result*10+ord(s[p])-ord('0'); + inc(p); + end; +end; + end.