| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines the numeric day of the week from a date.
DoW( <dDate> ) --> nDayOfWeek
The function returns the numeric day of the week or 0 for an empty date.
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.
| 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 |
// 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
http://www.xHarbour.com