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

This `struct` provides a namespace for a suite of pure functions that perform low&hyphen;level operations on date values in a variety of formats&period; Note that all of these functions, whether or not implemented in terms of a static cache, are stateless, and, as such, are inherently thread&hyphen;safe&period;

== Synopsis

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

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

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/PosixDateImpUtil/isLeapYear.adoc[`isLeapYear`] 
| Return `true` if the specified `year` is a leap year, and `false` otherwise&period; The behavior is undefined unless `1 &lt;&equals; year &lt;&equals; 9999`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidSerial.adoc[`isValidSerial`] 
| Return `true` if the specified `serialDay` represents a valid date value, and `false` otherwise&period; Note that valid date values are (as fully defined in the component&hyphen;level documentation) in the range `&lsqb; 1 &period;&period; 3652061 &rsqb;`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearDay.adoc[`isValidYearDay`] 
| Return `true` if the specified `year` and `dayOfYear` represents a valid date value, and `false` otherwise&period; Note that valid date values are (as fully defined in the component&hyphen;level documentation) in the range `&lsqb; 0001&sol;01 &period;&period; 9999&sol;365 &rsqb;` (except that `&lsqb; 1752&sol;356 &period;&period; 1752&sol;366 &rsqb;` are not valid for historical reasons)&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDay.adoc[`isValidYearMonthDay`] 
| Return `true` if the specified `year`, `month`, and `day` represents a valid date value, and `false` otherwise&period; Note that valid date values are (as fully defined in the component&hyphen;level documentation) in the range `&lsqb; 0001&sol;01&sol;01 &period;&period; 9999&sol;12&sol;31 &rsqb;` (except that `&lsqb; 1752&sol;09&sol;03 &period;&period; 1752&sol;09&sol;13 &rsqb;` are not valid for historical reasons)&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDayNoCache.adoc[`isValidYearMonthDayNoCache`] 
| Return `true` if the specified `year`, `month`, and `day` represents a valid date value, and `false` otherwise&period; Note that valid date values are (as fully defined in the component&hyphen;level documentation) in the range `&lsqb; 0001&sol;01&sol;01 &period;&period; 9999&sol;12&sol;31 &rsqb;` (except that `&lsqb; 1752&sol;09&sol;03 &period;&period; 1752&sol;09&sol;13 &rsqb;` are not valid for historical reasons)&period; Also note that this function is guaranteed not to use any date&hyphen;cache optimizations&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/lastDayOfMonth.adoc[`lastDayOfMonth`] 
| Return the last day of the specified `month` in 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; Note that the value returned will be in the range `&lsqb; 28 &period;&period; 31 &rsqb;`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/numLeapYears.adoc[`numLeapYears`] 
| Return the number of leap years occurring between the specified `year1` and `year2` (inclusive)&period; The behavior is undefined unless `1 &lt;&equals; year1 &lt;&equals; 9999`, `1 &lt;&equals; year2 &lt;&equals; 9999`, and `year1 &lt;&equals; year2`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDay.adoc[`serialToDay`] 
| Return the day (of the month) of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayNoCache.adoc[`serialToDayNoCache`] 
| Return the day (of the month) of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period; Note that this function is guaranteed not to use any date&hyphen;cache optimizations&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayOfWeek.adoc[`serialToDayOfWeek`] 
| Return, as an integer (with `1 &equals; SUN`, `2 &equals; MON`, &period;&period;&period;, and `7 &equals; SAT`), the day (of the week) of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayOfYear.adoc[`serialToDayOfYear`] 
| Return the day of the year of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToMonth.adoc[`serialToMonth`] 
| Return the month of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToMonthNoCache.adoc[`serialToMonthNoCache`] 
| Return the month of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period; Note that this function is guaranteed not to use any date&hyphen;cache optimizations&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYd.adoc[`serialToYd`] 
| Load, into the specified `year` and `dayOfYear`, the year&hyphen;day representation of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYear.adoc[`serialToYear`] 
| Return the year of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYearNoCache.adoc[`serialToYearNoCache`] 
| Return the year of the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period; Note that this function is guaranteed not to use any date&hyphen;cache optimizations&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmd.adoc[`serialToYmd`] 
| Load, into the specified `year`, `month`, and `day`, the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmdNoCache.adoc[`serialToYmdNoCache`] 
| Load, into the specified `year`, `month`, and `day`, the date value indicated by the specified `serialDay`&period; The behavior is undefined unless `true &equals;&equals; isValidSerial(serialDay)`&period; Note that this function is guaranteed not to use any date&hyphen;cache&hyphen;optimizations&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDay.adoc[`ydToDay`] 
| Return the day (of the month) of the date value indicated by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `true &equals;&equals; isValidYearDay(year, dayOfYear)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDayOfWeek.adoc[`ydToDayOfWeek`] 
| Return, as an integer (with `1 &equals; SUN`, `2 &equals; MON`, &period;&period;&period;, and `7 &equals; SAT`), the day (of the week) of the date value indicated by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `true &equals;&equals; isValidYearDay(year, dayOfYear)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToMd.adoc[`ydToMd`] 
| Load, into the specified `month` and `day`, the (partial) calendar date representation of the date value indicated by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `true &equals;&equals; isValidYearDay(year, dayOfYear)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToMonth.adoc[`ydToMonth`] 
| Return the month of the date value indicated by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `true &equals;&equals; isValidYearDay(year, dayOfYear)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToSerial.adoc[`ydToSerial`] 
| Return the serial date representation of the date value indicated by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `true &equals;&equals; isValidYearDay(year, dayOfYear)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToDayOfWeek.adoc[`ymdToDayOfWeek`] 
| Return, as an integer (with `1 &equals; SUN`, `2 &equals; MON`, &period;&period;&period;, and `7 &equals; SAT`), the day (of the week) of the date value indicated by the specified `year`, `month`, and `day`&period; The behavior is undefined unless `true &equals;&equals; isValidYearMonthDay(year, month, day)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToDayOfYear.adoc[`ymdToDayOfYear`] 
| Return the day of the year of the date value indicated by the specified `year`, `month`, and `day`&period; The behavior is undefined unless `true &equals;&equals; isValidYearMonthDay(year, month, day)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerial.adoc[`ymdToSerial`] 
| Return the serial date representation of the date value indicated by the specified `year`, `month`, and `day`&period; The behavior is undefined unless `true &equals;&equals; isValidYearMonthDay(year, month, day)`&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerialNoCache.adoc[`ymdToSerialNoCache`] 
| Return the serial date representation of the date value indicated by the specified `year`, `month`, and `day`&period; The behavior is undefined unless `true &equals;&equals; isValidYearMonthDay(year, month, day)`&period; Note that this function is guaranteed not to use any date&hyphen;cache optimizations&period;
|===



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