[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

TryEncodeTime

Try to encode a time, and indicate success.

Declaration

Source position: datih.inc line 100

function TryEncodeTime(

  Hour: Word;

  Min: Word;

  Sec: Word;

  MSec: Word;

  var Time: TDateTime

):Boolean;

Description

TryEncodeTimewill check the validity of the Hour, Min, Secand MSecarguments, and will encode them in a TDateTimevalue which is returned in T. If the arguments are valid, then Trueis returned, otherwise Falseis returned.

Errors

None. If an error occurs during the encoding, Falseis returned.

See also

EncodeTime

  

Encode a Hour,Min,Sec,millisec to a TDateTimevalue.

DecodeTime

  

Decode a TDateTimeto a hour,minute,second,millisec quartet

TryEncodeDate

  

Try to encode a date, and indicate success.