RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.IsValidDateTime Function

Indicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.

Pascal
function IsValidDateTime(const AYear: Word; const AMonth: Word; const ADay: Word; const AHour: Word; const AMinute: Word; const ASecond: Word; const AMilliSecond: Word): Boolean;
C++
Boolean IsValidDateTime(const Word AYear, const Word AMonth, const Word ADay, const Word AHour, const Word AMinute, const Word ASecond, const Word AMilliSecond);

DateUtils

IsValidDateTime returns true if 

AYear falls in the range from 1 to 9999 inclusive. 

AMonth falls in the range from 1 to 12 inclusive. 

ADay falls in the range from1 to the number of days in the specified month. 

AHour falls in the range from 0 to 24, and if AHour is 24, then AMinute, ASecond, and AMilliSecond must all be 0. 

AMinute falls in the range from 0 to 59 inclusive. 

ASecond falls in the range from 0 to 59 inclusive. 

AMilliSecond falls in the range from 0 to 999 inclusive. 

Otherwise, IsValidDateTime returns false. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!