System.DateUtils.IsValidDateTime
Delphi
function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): Boolean;
C++
extern DELPHI_PACKAGE bool __fastcall IsValidDateTime(const System::Word AYear, const System::Word AMonth, const System::Word ADay, const System::Word AHour, const System::Word AMinute, const System::Word ASecond, const System::Word AMilliSecond);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.DateUtils.pas System.DateUtils.hpp |
System.DateUtils | System.DateUtils |
Description
Indicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.
IsValidDateTime returns True if:
- AYear falls in the range from 1 through 9999 inclusive.
- AMonth falls in the range from 1 through 12 inclusive.
- ADay falls in the range from 1 through the number of days in the specified month.
- AHour falls in the range from 0 through 24, and if AHour is 24, then AMinute, ASecond, and AMilliSecond must all be 0.
- AMinute falls in the range from 0 through 59 inclusive.
- ASecond falls in the range from 0 through 59 inclusive.
- AMilliSecond falls in the range from 0 through 999 inclusive.
Otherwise, IsValidDateTime returns False.
See Also