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
 

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?
Explore Delphi Programming
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

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

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

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

All rights reserved.