Unit 'DateUtils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#rtl]

TimeOf

Extract the time part from a TDateTime indication.

Declaration

Source position: dateutil.inc line 97

function TimeOf(

  const AValue: TDateTime

):TDateTime;

Arguments

AValue

  

TDateTime value with the time extracted in the routine.

Function result

Time part of AValue.

Description

TimeOf extracts the time part from AValue and returns the result.

Since the TDateTime is actually a double with the time part encoded in the fractional part, this operation corresponds to a call to Frac.

See also

DateOf

  

Extract the date part from a TDateTime indication.

YearOf

  

Extract the year from a given date.

MonthOf

  

Extract the month from a given date.

DayOf

  

Extract the day (of month) part from a TDateTime value.

HourOf

  

Extract the hour part from a TDateTime value.

MinuteOf

  

Extract the minute part from a TDateTime value.

SecondOf

  

Extract the second part from a TDateTime value.

MilliSecondOf

  

Extract the millisecond part from a TDateTime value.

Example

Program Example2;

{ This program demonstrates the TimeOf function }

Uses SysUtils,DateUtils;

Begin
  Writeln('Time is : ',TimeToStr(TimeOf(Now)));
End.

Documentation generated on: Jul 25 2025