mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 20:39:13 +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
|
begin
|
||||||
If Not TryEncodeDate(Year,Month,Day,Result) then
|
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]);
|
[Year,Month,Day]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ function EncodeTime(Hour, Minute, Second, MilliSecond:word):TDateTime;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
If not TryEncodeTime(Hour,Minute,Second,MilliSecond,Result) then
|
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]);
|
[Hour,Minute,Second,MilliSecond]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user