1. Computing
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

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

DayOfTheWeek

unit
Sysutils
category
date/time routines

declaration
type TDateTime = type Double;

function DayOfTheWeek(Date: TDateTime): word;

description
Returns the day of the week for a given TDateTime value.

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

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

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

//Today is Friday

in real code

see also
DayOfWeek, 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.