[#BloombergLP-bdlt-Datetime-setYearDayIfValid] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Datetime.adoc[Datetime]::setYearDayIfValid :relfileprefix: ../../../ :mrdocs: 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. == Synopsis Declared in `<bdlt_datetime.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int setYearDayIfValid( int year, int dayOfYear); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#