System.DateUtils.RecodeTime
Delphi
function RecodeTime(const AValue: TDateTime; const AHour, AMinute, ASecond,
AMilliSecond: Word): TDateTime;
C++
extern DELPHI_PACKAGE System::TDateTime __fastcall RecodeTime(const System::TDateTime AValue, const System::Word AHour, const System::Word AMinute, const System::Word ASecond, const System::Word AMilliSecond);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.DateUtils.pas System.DateUtils.hpp |
System.DateUtils | System.DateUtils |
Description
Selectively replaces the time parts of a specified TDateTime value.
Call RecodeTime to convert the date/time value specified by AValue
with the value obtained by changing the hour to AHour
, the minute to AMinute
, the second to ASecond
, and the milliseconds to AMilliSecond
. Any one of these parameters can be set to RecodeLeaveFieldAsIs, which tells RecodeTime not change the existing portion of the TDateTime value specified in AValue
.
AHour
can range from 0 through 24 (or be RecodeLeaveFieldAsIs). If AHour
is 24, then AMinute
, ASecond
, and AMilliSecond
must all be 0.
AMinute
can range from 0 through 59 (or be RecodeLeaveFieldAsIs).
ASecond
can range from 0 through 59 (or be RecodeLeaveFieldAsIs).
AMilliSecond
can range from 0 through 999 (or be RecodeLeaveFieldAsIs).
If the values provided for AHour
, AMinute
, ASecond
, and AMilliSecond
do not result in a valid time, RecodeTime raises an EConvertError exception.
See Also
- System.SysUtils.ReplaceTime
- System.DateUtils.RecodeMilliSecond
- System.DateUtils.RecodeSecond
- System.DateUtils.RecodeMinute
- System.DateUtils.RecodeHour
- System.DateUtils.RecodeMonth
- System.DateUtils.RecodeYear
- System.DateUtils.RecodeDate
- System.SysUtils.EConvertError
- Date and Time Support