System.DateUtils.DateOf

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DateOf(const AValue: TDateTime): TDateTime;

C++

extern DELPHI_PACKAGE System::TDateTime __fastcall DateOf(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 time portion from a TDateTime value.

Call DateOf to convert a TDateTime value to a TDateTime value that includes only the date information (sets the time portion to 0, which means midnight).

Note: DateOf 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. DateOf(RoundTo(Value, -8))) prior to calling the DateOf routine.

See Also


Code Examples