RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.IsValidTime Function

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

Pascal
function IsValidTime(const AHour: Word; const AMinute: Word; const ASecond: Word; const AMilliSecond: Word): Boolean;
C++
Boolean IsValidTime(const Word AHour, const Word AMinute, const Word ASecond, const Word AMilliSecond);

IsValidTime returns true if 

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, IsValidTime returns false. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!