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

Namespace for low&hyphen;level POSIX&hyphen;calendar date conversion utilities&period;

== Synopsis

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

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

== Description

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;

== 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 whether `serialDay` is a valid serial date value&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearDay.adoc[`isValidYearDay`] 
| Return whether `year` and `dayOfYear` form a valid date&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDay.adoc[`isValidYearMonthDay`] 
| Return whether `year`&sol;`month`&sol;`day` is a valid POSIX calendar date&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDayNoCache.adoc[`isValidYearMonthDayNoCache`] 
| Return whether YMD is valid without using the date cache&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/lastDayOfMonth.adoc[`lastDayOfMonth`] 
| Return the last day of month for the given year and month&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/numLeapYears.adoc[`numLeapYears`] 
| Return the number of leap years between `year1` and `year2` inclusive&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 month for `serialDay` without using the date cache&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayOfWeek.adoc[`serialToDayOfWeek`] 
| Return the day of week (1&equals;SUN &period;&period; 7&equals;SAT) for the given serial day&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 for `serialDay` without using the date cache&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYd.adoc[`serialToYd`] 
| Load year and day&hyphen;of&hyphen;year from the given serial day&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 for `serialDay` without using the date cache&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmd.adoc[`serialToYmd`] 
| Load year, month, and day from the given serial day&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmdNoCache.adoc[`serialToYmdNoCache`] 
| Load YMD from `serialDay` without using the date cache&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDay.adoc[`ydToDay`] 
| Return the day of month for the given year and day&hyphen;of&hyphen;year&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDayOfWeek.adoc[`ydToDayOfWeek`] 
| Return the day of week (1&equals;SUN &period;&period; 7&equals;SAT) for year and day&hyphen;of&hyphen;year&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ydToMd.adoc[`ydToMd`] 
| Load month and day from the given year and day&hyphen;of&hyphen;year&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 for the given year and day&hyphen;of&hyphen;year&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToDayOfWeek.adoc[`ymdToDayOfWeek`] 
| Return the day of week (1&equals;SUN &period;&period; 7&equals;SAT) for the given YMD date&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToDayOfYear.adoc[`ymdToDayOfYear`] 
| Return the day of year for the given year, month, and day&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerial.adoc[`ymdToSerial`] 
| Return the serial date for the given year, month, and day&period;
| xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerialNoCache.adoc[`ymdToSerialNoCache`] 
| Return the serial date for YMD without using the date cache&period;
|===



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