BloombergLP::bdlt::Datetime::setYearDayIfValid

Set the date from year and dayOfYear if they form a valid date.

Synopsis

Declared in <bdlt_datetime.h>

int
setYearDayIfValid(
    int year,
    int dayOfYear);

Description

Set this object to have the value represented by the specified year and dayOfYear if they comprise a valid Date value (see Date::isValidYearDay). Return 0 on success, and a non-zero value (with no effect) otherwise.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
yearyear attribute
dayOfYearday-of-year attribute