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 năm trước cách đây
mục cha
commit
9a4dc8c43c
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  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