Sign in Join
FPDoc Onlineexperiment

StartOfAYear function

In unit DateUtils

Return the first day of a given year.

Declaration

pascal
function StartOfAYear(const AYear: Word): TDateTime

Arguments

AYear

Year to get first date from.

Function result

First day of AYear as a TDateTime.

Description

StartOfAYear returns a TDateTime value with the date of the first day of the year AYear (January 1).

See also

Example: ex26

pascal
Program Example26;

{ This program demonstrates the StartOfAYear function }

Uses SysUtils,DateUtils;

Const
  Fmt = '"First day of this year : "dd mmmm yyyy';

Begin
  Writeln(FormatDateTime(Fmt,StartOfAYear(YearOf(Today))));
End.

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