Fix for Mantis #24929.

rtl/sysutils/datih.inc:
  + add StrToDate overload which allows passing of specific TFormatSettings parameter
rtl/sysutils/dati.inc:
  * implement new StrToDate overload by calling IntStrToDate similar to StrToTime

git-svn-id: trunk@25392 -
This commit is contained in:
svenbarth 2013-09-01 12:46:54 +00:00
parent 38ae8c7250
commit b288179d56
2 changed files with 10 additions and 0 deletions

View File

@ -502,6 +502,15 @@ begin
Raise EConvertError.Create(Msg);
end;
function StrToDate(const S: string; FormatSettings: TFormatSettings): TDateTime;
var
Msg: AnsiString;
begin
Result:=IntStrToDate(Msg,@S[1],Length(S),FormatSettings.ShortDateFormat,FormatSettings);
if Msg<>'' then
raise EConvertError.Create(Msg);
end;
function StrToDate(const S: ShortString; const useformat : string; separator : char = #0): TDateTime;
begin
result := StrToDate(@S[1],Length(s),UseFormat,separator);

View File

@ -125,6 +125,7 @@ function StrToDate(const S: ShortString): TDateTime; {$ifdef SY
function StrToDate(const S: Ansistring): TDateTime; {$ifdef SYSUTILSINLINE}inline;{$endif}
function StrToDate(const S: ShortString; separator : char): TDateTime;{$ifdef SYSUTILSINLINE}inline;{$endif}
function StrToDate(const S: AnsiString; separator : char): TDateTime; {$ifdef SYSUTILSINLINE}inline;{$endif}
function StrToDate(const S: string; FormatSettings : TFormatSettings): TDateTime;
function StrToTime(const S: Shortstring): TDateTime; {$ifdef SYSUTILSINLINE}inline;{$endif}
function StrToTime(const S: Ansistring): TDateTime; {$ifdef SYSUTILSINLINE}inline;{$endif}
function StrToTime(const S: ShortString; separator : char): TDateTime;{$ifdef SYSUTILSINLINE}inline;{$endif}