瀏覽代碼

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

git-svn-id: trunk@28687 -
marco 11 年之前
父節點
當前提交
29e5418a4f
共有 1 個文件被更改,包括 2 次插入14 次删除
  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;