Browse Source

* Merging revisions 918 from trunk:
------------------------------------------------------------------------
r918 | michael | 2020-11-05 09:51:34 +0100 (Thu, 05 Nov 2020) | 1 line

* Allow seconds to be empty
------------------------------------------------------------------------

michael 4 years ago
parent
commit
465e01eac9
1 changed files with 5 additions and 2 deletions
  1. 5 2
      packages/rtl/dateutils.pas

+ 5 - 2
packages/rtl/dateutils.pas

@@ -2442,8 +2442,11 @@ begin
     begin
     lH:=StrToIntDef(Copy(AValue,P[ppHour],2),-1);
     lMi:=StrToIntDef(Copy(AValue,P[ppMinute],2),-1);
-    lS:=StrToIntDef(Copy(AValue,P[ppSec],2),-1);
-
+    // Bug ID 37974
+    if (Length(AValue)>=P[ppSec]) then
+      lS:=StrToIntDef(Copy(AValue,P[ppSec],2),-1)
+    else
+      LS:=0;
     if (Length(AValue)>=P[ppMSec]) then
       lmS := StrToIntDef(Copy(AValue,P[ppMSec],3),-1);
     end