mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-11 15:10:40 +01:00
* change mysql datetime parsing because mysql allows time >24hrs (interval like).
Matnis #21368, Patch by Lacak2. git-svn-id: trunk@20464 -
This commit is contained in:
parent
d676e18326
commit
c6da7f726d
@ -818,11 +818,13 @@ function InternalStrToTime(S: string): TDateTime;
|
||||
|
||||
var
|
||||
EH, EM, ES: Word;
|
||||
p: integer;
|
||||
|
||||
begin
|
||||
EH := StrToInt(Copy(S, 1, 2));
|
||||
EM := StrToInt(Copy(S, 4, 2));
|
||||
ES := StrToInt(Copy(S, 7, 2));
|
||||
p := 1;
|
||||
EH := StrToInt(ExtractSubstr(S, p, [':'])); //hours can be 2 or 3 digits
|
||||
EM := StrToInt(ExtractSubstr(S, p, [':']));
|
||||
ES := StrToInt(ExtractSubstr(S, p, ['.']));
|
||||
Result := EncodeTimeInterval(EH, EM, ES, 0);
|
||||
end;
|
||||
|
||||
@ -852,7 +854,7 @@ begin
|
||||
Result := 0
|
||||
else
|
||||
Result := EncodeDate(EY, EM, ED);
|
||||
Result := Result + EncodeTime(EH, EN, ES, 0);;
|
||||
Result := Result + EncodeTime(EH, EN, ES, 0);
|
||||
end;
|
||||
|
||||
function TConnectionName.MySQLWriteData(AField: PMYSQL_FIELD; FieldDef: TFieldDef; Source, Dest: PChar; Len: integer; out CreateBlob : boolean): Boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user