xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DoW()

Determines the numeric day of the week from a date.

Syntax

DoW( <dDate> ) --> nDayOfWeek

Arguments

<dDate>
The parameter must be a value of data type Date.

Return

The function returns the numeric day of the week or 0 for an empty date.

Description

DoW() calculates the numeric day of the week from a Date value. Weekdays are numbered from One to Seven, with Sunday being 1 and Saturday being 7.

Info

See also:CDow(), CtoD(), Date(), Day(), DtoC(), DtoS(), SET CENTURY, SET DATE, StoD(), Transform()
Category: Conversion functions , Date and time
Source:rtl\dateshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example illustrates CDoW() and Dow() return values.

   PROCEDURE Main
      LOCAL dDate := CtoD( "01/01/2006" )

      ? CDoW( dDate )                  // result: Sunday
      ? DoW ( dDate )                  // result: 1

      ? CDoW( dDate+4 )                // result: Thursday
      ? DoW ( dDate+4 )                // result: 5
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe