Skip to main content

EncodeTime

Returns a TDateTime value for a specified Hour, Min, Sec, and Msec.

Structure

EncodeTime(Hour, Min, Sec, Msec: Word): TDateTime;

Parameters

Return Value

Description

EncodeTime encodes the given hour, minute, second, and millisecond into a TDateTime value. Valid Hour values are 0 through 23. Valid Min and Sec values are 0 through 59. Valid Msec values are 0 through 999. If the specified values are not within range, an EConvertError exception is raised.

The resulting value is a number between 0 (inclusive) and 1 (not inclusive) that indicates the fractional part of a day given by the specified time. The value 0 corresponds to midnight, 0.5 corresponds to noon, 0.75 corresponds to 6:00 pm, and so on. |