DateUtils.IsValidDateTime
From RAD Studio VCL Reference
Contents |
Delphi Information
From DateUtils.pas
function IsValidDateTime(const AYear: Word; const AMonth: Word; const ADay: Word; const AHour: Word; const AMinute: Word; const ASecond: Word; const AMilliSecond: Word): Boolean;
Unit: DateUtils
Type: function
Visibility: public
C++ Information
From DateUtils.hpp
bool __fastcall IsValidDateTime(unsigned short AYear, unsigned short AMonth, unsigned short ADay, unsigned short AHour, unsigned short AMinute, unsigned short ASecond, unsigned short AMilliSecond);
Unit: DateUtils
Type: function
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
Code Samples