[Overview][Constants][Procedures and functions][Index] Reference for unit 'DateUtils' (#rtl)

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;

Arguments

AValue

  

Date in year of which to return the start

Function result

First day of the year as a TDateTime value.

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

StartOfAYear

  

Return the first day of a given year.

EndOfTheYear

  

Calculate a TDateTime value representing the last day of a year, given a date in that year.

EndOfAYear

  

Calculate a TDateTime value representing the last day of a 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.

Documentation generated on: Jun 22 2020