mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 02:32:51 +02:00
+ EncodeDate routines raise EConvertError as needed
git-svn-id: trunk@110 -
This commit is contained in:
parent
f9fe00482d
commit
08c7681c60
@ -130,7 +130,7 @@ function EncodeDate(Year, Month, Day: word): TDateTime;
|
||||
|
||||
begin
|
||||
If Not TryEncodeDate(Year,Month,Day,Result) then
|
||||
Raise Exception.CreateFmt('%d-%d-%d is not a valid date specification',
|
||||
Raise EConvertError.CreateFmt('%d-%d-%d is not a valid date specification',
|
||||
[Year,Month,Day]);
|
||||
end;
|
||||
|
||||
@ -141,7 +141,7 @@ function EncodeTime(Hour, Minute, Second, MilliSecond:word):TDateTime;
|
||||
|
||||
begin
|
||||
If not TryEncodeTime(Hour,Minute,Second,MilliSecond,Result) then
|
||||
Raise Exception.CreateFmt('%d:%d:%d.%d is not a valid time specification',
|
||||
Raise EConvertError.CreateFmt('%d:%d:%d.%d is not a valid time specification',
|
||||
[Hour,Minute,Second,MilliSecond]);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user