1. Computing
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?

©2013 About.com. All rights reserved.