From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function RecodeHour(const AValue: TDateTime; const AHour: Word): TDateTime;


extern DELPHI_PACKAGE System::TDateTime __fastcall RecodeHour(const System::TDateTime AValue, const System::Word AHour);


Type Visibility Source Unit Parent
function public
System.DateUtils System.DateUtils


Replaces the hour of the day for a specified TDateTime value.

Call RecodeHour to convert the date/time value specified by AValue with the value obtained by changing the hour of the day to AHour. Legal values for AHour range from 0 through 24. If AHour is 24, the minutes, seconds, and milliseconds of AValue must all be 0.

If the value provided for AHour is not in the legal range, RecodeHour raises an EConvertError exception.

See Also

Code Examples