System.DateUtils.TimeOf

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function TimeOf(const AValue: TDateTime): TDateTime;

C++

extern DELPHI_PACKAGE System::TDateTime __fastcall TimeOf(const System::TDateTime AValue);

Properties

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

Description

Strips the date portion from a TDateTime value.

Call TimeOf to convert a TDateTime value to a TDateTime value that includes only the time information (sets the date portion to 0, which means 12/30/1899).

Note: TimeOf can yield an invalid result for TDateTime values that were manually calculated (using Arithmetics). In such a case, we recommend that you round the value (ex. TimeOf(RoundTo(Value, -8))) prior to calling the TimeOf routine.

See Also


Code Examples