DAY_OF_WEEK Function

Returns an array of integers containing the day of the week for each date in a Date/Time variable.

Usage

    result = DAY_OF_WEEK(dt_var)

Input Parameters

dt_var — A Date/Time variable.

Returned Value

result — The day of the week expressed as an integer. Day 0 is Sunday and day 6 is Saturday.

Keywords

None.

Example

Assume that you have a Date/Time variable, date, for April 13, 1992. To find out which day of the week this date is, enter:

; Create a Date/Time variable for April 13, 1992. 
date = STR_TO_DT('04-13-1992', Date_Fmt=1)

; Find the day of the week for this date.
day = DAY_OF_WEEK(date)
PRINT, day
; PV-WAVE prints: 1
; This indicates the day is a Monday.

See Also

DAY_NAME,   DAY_OF_YEAR,   MONTH_NAME

For more information on Date/Time data, see the PV‑WAVE User Guide.