TryEncodeTime

Try to encode a time, and indicate success.

Declaration

Source position: datih.inc line 118

  function TryEncodeTime(Hour: Word; Min: Word; Sec: Word; MSec: Word; 
                        out Time: TDateTime) : Boolean;

Description

TryEncodeTime will check the validity of the Hour, Min, Sec and MSec arguments, and will encode them in a TDateTime value which is returned in Time. If the arguments are valid, then True is returned, otherwise False is returned.

Errors

None. If an error occurs during the encoding, False is returned.

See also

Name Description
DecodeTime Decode a TDateTime to a hour,minute,second,millisec quartet
EncodeTime Encode a Hour,Min,Sec,millisec to a TDateTime value.
TryEncodeDate Try to encode a date, and indicate success.