BloombergLP::bdlt::Date::setYearMonthDayIfValid

Set this date from Y/M/D if they form a valid value; otherwise do nothing.

Synopsis

Declared in <bdlt_date.h>

int
setYearMonthDayIfValid(
    int year,
    int month,
    int day);

Description

Set this object to have the value represented by the specified year, month, and day if they comprise a valid Date value (see isValidYearMonthDay). 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 of the candidate date
monthmonth of the candidate date
dayday of month of the candidate date