System.DateUtils.DayOfTheWeek

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DayOfTheWeek(const AValue: TDateTime): Word;

C++

extern DELPHI_PACKAGE System::Word __fastcall DayOfTheWeek(const System::TDateTime AValue);

Properties

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

Description

Returns the day of the week represented by a TDateTime value.

Call DayOfTheWeek to obtain the day of the week represented by a specified TDateTime value. DayOfTheWeek returns a value from 1 through 7, where 1 indicates Monday and 7 indicates Sunday.

Note: DayOfTheWeek is ISO 8601 compliant (where Monday is considered the first day of the week). To obtain the day of the week, where Sunday is considered the first day of the week, use the DayOfWeek function instead.

Tip: To make the return value more readable, use the day of week constants:

DayMonday

DayMonday: Integer = 1

DayTuesday

DayTuesday: Integer = 2;

DayWednesday

DayWednesday: Integer = 3;

DayThursday

DayThursday: Integer = 4;

DayFriday

DayFriday: Integer = 5;

DaySaturday

DaySaturday: Integer = 6;

DaySunday

DaySunday: Integer = 7;


See Also

Code Examples