StartOfTheYear

Return the first day of the year, given a date in this year.

Declaration

Source position: dateutil.inc line 134

  function StartOfTheYear(const AValue: TDateTime) : TDateTime;

Description

StartOfTheYear extracts the year part of AValue and returns a TDateTime value with the date of the first day of that year (January 1), as the StartOfAYear function.

See also

Name Description
EndOfAYear Calculate a TDateTime value representing the last day of a year
EndOfTheYear Calculate a TDateTime value representing the last day of a year, given a date in that year.
StartOfAYear Return the first day of a given year.

Example

Program Example24;
{ This program demonstrates the StartOfTheYear function }
Uses SysUtils,DateUtils;
Const
  Fmt = '"First day of this year : "dd mmmm yyyy';
Begin
  Writeln(FormatDateTime(Fmt,StartOfTheYear(Today)));
End.