System.SysUtils.DayOfWeek

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DayOfWeek(const DateTime: TDateTime): Word;

C++

extern DELPHI_PACKAGE System::Word __fastcall DayOfWeek(const System::TDateTime DateTime);

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Returns the day of the week for a specified date.

DayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.

Note: DayOfWeek is not compliant with the ISO 8601 standard, which defines Monday as the first day of the week. For an ISO 8601 compliant version, use the DayOfTheWeek function instead.

See Also


Code Examples