[#BloombergLP-bdlt-Datetime-setYearMonthDayIfValid] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Datetime.adoc[Datetime]::setYearMonthDayIfValid :relfileprefix: ../../../ :mrdocs: Set the date from year/month/day if they form a valid date. == Synopsis Declared in `<bdlt_datetime.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 `Date::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 [cols="1,4"] |=== | Name| Description | *year* | year attribute | *month* | month attribute | *day* | day‐of‐month attribute |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#