BloombergLP::bdlt::ProlepticDateImpUtil::ydToDayOfWeek

Return the day of the week for the specified year and day-of-year.

Synopsis

Declared in <bdlt_prolepticdateimputil.h>

static
int
ydToDayOfWeek(
    int year,
    int dayOfYear);

Description

Return, as an integer (with 1 = SUN, 2 = MON, ..., 7 = SAT), the day (of the week) of the date value indicated by the specified year and dayOfYear. The behavior is undefined unless isValidYearDay(year, dayOfYear) returns true.

Return Value

day of week in [1 .. 7] (1 = SUN .. 7 = SAT)

Parameters

NameDescription
yearcalendar year
dayOfYearday of year