RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.TryEncodeTime Function

Creates a TDateTime value for a specified Hour, Min, Sec, and MSec.

Pascal
function TryEncodeTime(Hour: Word; Min: Word; Sec: Word; MSec: Word; out Time: TDateTime): Boolean;
C++
Boolean TryEncodeTime(Word Hour, Word Min, Word Sec, Word MSec, TDateTime Time);

EncodeTime encodes the given hour, minute, second, and millisecond into a TDateTime value.  

Valid Hour values are 0 through 24. If Hour is 24, Min, Sec, and MSec must all be 0, and the resulting TDateTime value represents midnight (12:00:00:000 AM) of the following day. 

Valid Min and Sec values are 0 through 59.  

Valid MSec values are 0 through 999. 

The Time paremter returns the generated TDateTime value of the specifies values are in range. This value is a number between 0 and 1 (inclusive) that indicates the fractional part of a day given by the specified time or (if 1.0) midnight on the following day. The value 0 corresponds to midnight, 0.5 corresponds to noon, 0.75 corresponds to 6:00 pm, and so on. 

 

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