Sign in Join
FPDoc Onlineexperiment

StartOfTheWeek function

In unit DateUtils

Return the first day of the week, given a date.

Declaration

pascal
function StartOfTheWeek(const AValue: TDateTime): TDateTime

Arguments

AValue

Day in the week.

Function result

First day of the week, in TDateTime format.

Description

StartOfTheWeek extracts the year and week parts of AValue and returns a TDateTime value with the date of the first day of that week as the StartOfAWeek function.

See also

Example: ex32

pascal
Program Example32;

{ This program demonstrates the StartOfTheWeek function }

Uses SysUtils,DateUtils;

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

Begin
  Writeln(FormatDateTime(Fmt,StartOfTheWeek(Today)));
End.

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