Browse Source

* remove construct with exception, mantis #26738, patch by Alexander.

git-svn-id: trunk@28687 -
marco 11 years ago
parent
commit
29e5418a4f
1 changed files with 2 additions and 14 deletions
  1. 2 14
      rtl/objpas/sysutils/dati.inc

+ 2 - 14
rtl/objpas/sysutils/dati.inc

@@ -1380,24 +1380,12 @@ end;
 
 function TryStrToDateTime(const S: ShortString; out Value: TDateTime): Boolean;
   begin
-    result:=true;
-    try
-      value:=StrToDateTime(s);
-    except
-      on EConvertError do
-        result:=false
-    end;
+    result := TryStrToDateTime(S, Value, DefaultFormatSettings);
   end;
 
 function TryStrToDateTime(const S: AnsiString; out Value: TDateTime): Boolean;
   begin
-    result:=true;
-    try
-      value:=StrToDateTime(s);
-    except
-      on EConvertError do
-        result:=false
-    end;
+    result := TryStrToDateTime(S, Value, DefaultFormatSettings);
   end;
 
 function TryStrToDateTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;