[#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‐primitive operations on dates. == Synopsis Declared in `<bdlt_dateutil.h>` [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. | xref:BloombergLP/bdlt/DateUtil/addMonthsEom.adoc[`addMonthsEom`] | Return `original` advanced by `numMonths` with end‐of‐month rules. | xref:BloombergLP/bdlt/DateUtil/addMonthsNoEom.adoc[`addMonthsNoEom`] | Return `original` advanced by `numMonths` without EOM preservation. | xref:BloombergLP/bdlt/DateUtil/addYears.adoc[`addYears`] | Return `original` advanced by `numYears`, optionally preserving EOM. | xref:BloombergLP/bdlt/DateUtil/addYearsEom.adoc[`addYearsEom`] | Return `original` advanced by `numYears` with end‐of‐month rules. | xref:BloombergLP/bdlt/DateUtil/addYearsNoEom.adoc[`addYearsNoEom`] | Return `original` advanced by `numYears` without EOM preservation. | xref:BloombergLP/bdlt/DateUtil/convertFromYYYYMMDD.adoc[`convertFromYYYYMMDD`] | Load `*result` from the "YYYYMMDD" encoding of `yyyymmddValue`. | xref:BloombergLP/bdlt/DateUtil/convertFromYYYYMMDDRaw.adoc[`convertFromYYYYMMDDRaw`] | Return the `Date` represented by the "YYYYMMDD" value `yyyymmddValue`. | xref:BloombergLP/bdlt/DateUtil/convertToYYYYMMDD.adoc[`convertToYYYYMMDD`] | Return the "YYYYMMDD" integer encoding of the specified `date`. | xref:BloombergLP/bdlt/DateUtil/earliestDayOfWeekInMonth.adoc[`earliestDayOfWeekInMonth`] | Return the earliest `dayOfWeek` in the given month and year. | xref:BloombergLP/bdlt/DateUtil/fromYmd.adoc[`fromYmd`] | Return a `Date` for `year`/`month`/`day` if valid; otherwise empty. | xref:BloombergLP/bdlt/DateUtil/isValidYYYYMMDD.adoc[`isValidYYYYMMDD`] | Return `true` if the specified `yyyymmddValue` represents a valid `Date` value in the "YYYYMMDD" format, and `false` otherwise. | xref:BloombergLP/bdlt/DateUtil/lastDayInMonth.adoc[`lastDayInMonth`] | Return the latest date in the specified `month` of the specified `year`. The behavior is undefined unless `1 <= year <= 9999` and `1 <= month <= 12`. | xref:BloombergLP/bdlt/DateUtil/lastDayOfWeekInMonth.adoc[`lastDayOfWeekInMonth`] | Return the latest `dayOfWeek` in the given month and year. | xref:BloombergLP/bdlt/DateUtil/nextDayOfWeek.adoc[`nextDayOfWeek`] | Return the next occurrence of `dayOfWeek` after `date`. | xref:BloombergLP/bdlt/DateUtil/nextDayOfWeekInclusive.adoc[`nextDayOfWeekInclusive`] | Return the next occurrence of `dayOfWeek` on or after `date`. | xref:BloombergLP/bdlt/DateUtil/nthDayOfWeekInMonth.adoc[`nthDayOfWeekInMonth`] | Return the `n`th `dayOfWeek` in the given month and year. | xref:BloombergLP/bdlt/DateUtil/previousDayOfWeek.adoc[`previousDayOfWeek`] | Return the previous occurrence of `dayOfWeek` before `date`. | xref:BloombergLP/bdlt/DateUtil/previousDayOfWeekInclusive.adoc[`previousDayOfWeekInclusive`] | Return the previous occurrence of `dayOfWeek` on or before `date`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#