YearOf function
Extract the year from a given date.
Declaration
function YearOf(const AValue: TDateTime): WordArguments
AValue | Date to extract year from. |
Function result
Year part of
AValue.
Description
YearOf returns the year part of the
AValue date/time
indication. It is a number between 1 and 9999.See also
Example: ex23
Program Example23;
{ This program demonstrates the YearOf function }
Uses SysUtils,DateUtils;
Var
D : TDateTime;
Begin
D:=Now;
Writeln('Year : ',YearOf(D));
Writeln('Month : ',MonthOf(D));
Writeln('Day : ',DayOf(D));
Writeln('Week : ',WeekOf(D));
Writeln('Hour : ',HourOf(D));
Writeln('Minute : ',MinuteOf(D));
Writeln('Second : ',SecondOf(D));
Writeln('MilliSecond : ',MilliSecondOf(D));
End.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
