[#BloombergLP-bdlt-DateUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::DateUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for utility functions that provide non&hyphen;primitive operations on dates&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;dateutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct DateUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/DateUtil/addMonths.adoc[`addMonths`] 
| Return `original` advanced by `numMonths`, optionally preserving EOM&period;
| xref:BloombergLP/bdlt/DateUtil/addMonthsEom.adoc[`addMonthsEom`] 
| Return `original` advanced by `numMonths` with end&hyphen;of&hyphen;month rules&period;
| xref:BloombergLP/bdlt/DateUtil/addMonthsNoEom.adoc[`addMonthsNoEom`] 
| Return `original` advanced by `numMonths` without EOM preservation&period;
| xref:BloombergLP/bdlt/DateUtil/addYears.adoc[`addYears`] 
| Return `original` advanced by `numYears`, optionally preserving EOM&period;
| xref:BloombergLP/bdlt/DateUtil/addYearsEom.adoc[`addYearsEom`] 
| Return `original` advanced by `numYears` with end&hyphen;of&hyphen;month rules&period;
| xref:BloombergLP/bdlt/DateUtil/addYearsNoEom.adoc[`addYearsNoEom`] 
| Return `original` advanced by `numYears` without EOM preservation&period;
| xref:BloombergLP/bdlt/DateUtil/convertFromYYYYMMDD.adoc[`convertFromYYYYMMDD`] 
| Load `&ast;result` from the &quot;YYYYMMDD&quot; encoding of `yyyymmddValue`&period;
| xref:BloombergLP/bdlt/DateUtil/convertFromYYYYMMDDRaw.adoc[`convertFromYYYYMMDDRaw`] 
| Return the `Date` represented by the &quot;YYYYMMDD&quot; value `yyyymmddValue`&period;
| xref:BloombergLP/bdlt/DateUtil/convertToYYYYMMDD.adoc[`convertToYYYYMMDD`] 
| Return the &quot;YYYYMMDD&quot; integer encoding of the specified `date`&period;
| xref:BloombergLP/bdlt/DateUtil/earliestDayOfWeekInMonth.adoc[`earliestDayOfWeekInMonth`] 
| Return the earliest `dayOfWeek` in the given month and year&period;
| xref:BloombergLP/bdlt/DateUtil/fromYmd.adoc[`fromYmd`] 
| Return a `Date` for `year`&sol;`month`&sol;`day` if valid&semi; otherwise empty&period;
| xref:BloombergLP/bdlt/DateUtil/isValidYYYYMMDD.adoc[`isValidYYYYMMDD`] 
| Return `true` if the specified `yyyymmddValue` represents a valid `Date` value in the &quot;YYYYMMDD&quot; format, and `false` otherwise&period;
| xref:BloombergLP/bdlt/DateUtil/lastDayInMonth.adoc[`lastDayInMonth`] 
| Return the latest date in the specified `month` of the specified `year`&period; The behavior is undefined unless `1 &lt;&equals; year &lt;&equals; 9999` and `1 &lt;&equals; month &lt;&equals; 12`&period;
| xref:BloombergLP/bdlt/DateUtil/lastDayOfWeekInMonth.adoc[`lastDayOfWeekInMonth`] 
| Return the latest `dayOfWeek` in the given month and year&period;
| xref:BloombergLP/bdlt/DateUtil/nextDayOfWeek.adoc[`nextDayOfWeek`] 
| Return the next occurrence of `dayOfWeek` after `date`&period;
| xref:BloombergLP/bdlt/DateUtil/nextDayOfWeekInclusive.adoc[`nextDayOfWeekInclusive`] 
| Return the next occurrence of `dayOfWeek` on or after `date`&period;
| xref:BloombergLP/bdlt/DateUtil/nthDayOfWeekInMonth.adoc[`nthDayOfWeekInMonth`] 
| Return the `n`th `dayOfWeek` in the given month and year&period;
| xref:BloombergLP/bdlt/DateUtil/previousDayOfWeek.adoc[`previousDayOfWeek`] 
| Return the previous occurrence of `dayOfWeek` before `date`&period;
| xref:BloombergLP/bdlt/DateUtil/previousDayOfWeekInclusive.adoc[`previousDayOfWeekInclusive`] 
| Return the previous occurrence of `dayOfWeek` on or before `date`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
