DelphiBasics
LongDayNames
Variable
An array of days of the week names, starting 1 = Sunday SysUtils unit
  var LongDayNames : array[1..7] of string;
  array[1] := 'Sunday';
  array[2] := 'Monday';
  array[3] := 'Tuesday';
  array[4] := 'Wednesday';
  array[5] := 'Thursday';
  array[6] := 'Friday';
  array[7] := 'Saturday';
Description
The LongDayNames variable provides an array of full string names of the days of the week.
 
Since it is an array, you can update the default values (set by the Windows locale), but this is not advised.
Notes
Warning : these values use Sunday as the starting value. This is not ISO 8601 compliant. Use with DayOfWeek, which also treats Sunday as the first day of the week.

You are advised to use DayOfTheWeek, which is ISO 8601 compliant, using Monday as the start of the week.
Related commands
LongMonthNames An array of days of the month names, starting 1 = January
ShortDayNames An array of days of the week names, starting 1 = Sunday
ShortMonthNames An array of days of the month names, starting 1 = Jan
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 Download this web site as a Windows program.




 
Example code : Show the day of the week for Christmas 2002
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.
 
unit Unit1;
 
interface
 
uses
  SysUtils,   // Unit containing the LongDayNames command
  Forms, Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);

var
  myDate : TDateTime;
  day    : string;

begin
  myDate := EncodeDate(2002, 12, 31);

  day := LongDayNames[DayOfWeek(myDate)];

  ShowMessage('Christmas day 2002 is on a '+day);
end;
 
end.
Hide full unit code
   Christmas day 2002 is on a Tuesday
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page