1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

DayOfWeek

unit
Sysutils
category
date/time routines

declaration
type TDateTime = type Double;

function DayOfWeek(Date: TDateTime): integer;

description
Returns the day of the week for a given date.

DayOfWeek returns an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.
DayOfTheWeek is not compliant with the ISO 8601 standard.

example
const Days: array[1..7] of string =
           ('Sunday', 'Monday', 'Tuesday',
            'Wednesday', 'Thursday',
            'Friday', 'Saturday')

ShowMessage('Today is  ' + Days[DayOfWeek(Date)]);

//Today is Monday

in real code

see also
DayOfTheWeek, TDateTime, Date,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.