Previous Topic: VerifyNext Topic: Yesterday


Weekday

The weekday functions return the name of the day that corresponds to a specified date.

Syntax:

►►─┬─ WEEKDAY (date, 'input-date-format') ─┬──────────────────────────────────►◄
   └─┬─ GWEEKDAY ─┬─ (date) ───────────────┘
     ├─ CWEEKDAY ─┤
     ├─ EWEEKDAY ─┤
     └─ JWEEKDAY ─┘
►►─┬─ WEEKDAYX (century-date, 'input-date-format') ─┬─────────────────────────►◄
   └─┬─ GWEEKDAYX ─┬─ (century-date) ───────────────┘
     ├─ CWEEKDAYX ─┤
     ├─ EWEEKDAYX ─┤
     └─ JWEEKDAYX ─┘

Invocation names:

      WEEKDAY               WEEKDAYX
GWEEKDAY   EWEEKDAY   GWEEKDAYX   EWEEKDAYX
CWEEKDAY   JWEEKDAY   CWEEKDAYX   JWEEKDAYX

Parameters:

date

Specifies the six-byte object date for the weekday function.

Date can be:

century-date

Specifies the eight-byte object date (containing the century) for the weekday function.

Century date can be:

'input-date-format'

Specifies the format of the date specified by date or century-date.

Input date can be:

Examples:

Example 1

This example determines the weekday on which January 28, 1958, fell; the date is provided in calendar format:

compute weekday = weekday(012858,'c')

  'TUESDAY'

Example 2

This example determines the weekday on which November 12, 1991 fell; the date is provided in Julian format:

compute weekday = jweekday(91316)

  'TUESDAY'

Example 3

This example determines the weekday on which January 28, 1958, fell; the date is provided in calendar format. The input date contains the century portion of the year:

compute weekday = weekdayx(01281958,'c')

  'TUESDAY'