Sign in Join
FPDoc Onlineexperiment

StartOfTheYear function

In unit DateUtils

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

Declaration

pascal
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

Example: ex24

pascal
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.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.