Sign in Join
FPDoc Onlineexperiment

DayOfWeek function

In unit sysutils

Returns the day of the week.

Declaration

pascal
function DayOfWeek(DateTime: TDateTime): Integer

Description

DayOfWeek returns the day of the week from DateTime. Sunday is counted as day 1, Saturday is counted as day 7. The result of DayOfWeek can serve as an index to the LongDayNames constant array, to retrieve the name of the day.

Errors

None.

See also

Example: ex8

pascal
Program Example8;

{ This program demonstrates the DayOfWeek function }

Uses sysutils;

Begin
  Writeln ('Today''s day is ',LongDayNames[DayOfWeek(Date)]);
End.

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