[#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‐level operations on date values in a variety of formats. Note that all of these functions, whether or not implemented in terms of a static cache, are stateless, and, as such, are inherently thread‐safe. == Synopsis Declared in `<bdlt_posixdateimputil.h>` [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. The behavior is undefined unless `1 <= year <= 9999`. | xref:BloombergLP/bdlt/PosixDateImpUtil/isValidSerial.adoc[`isValidSerial`] | Return `true` if the specified `serialDay` represents a valid date value, and `false` otherwise. Note that valid date values are (as fully defined in the component‐level documentation) in the range `[ 1 .. 3652061 ]`. | xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearDay.adoc[`isValidYearDay`] | Return `true` if the specified `year` and `dayOfYear` represents a valid date value, and `false` otherwise. Note that valid date values are (as fully defined in the component‐level documentation) in the range `[ 0001/01 .. 9999/365 ]` (except that `[ 1752/356 .. 1752/366 ]` are not valid for historical reasons). | xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDay.adoc[`isValidYearMonthDay`] | Return `true` if the specified `year`, `month`, and `day` represents a valid date value, and `false` otherwise. Note that valid date values are (as fully defined in the component‐level documentation) in the range `[ 0001/01/01 .. 9999/12/31 ]` (except that `[ 1752/09/03 .. 1752/09/13 ]` are not valid for historical reasons). | xref:BloombergLP/bdlt/PosixDateImpUtil/isValidYearMonthDayNoCache.adoc[`isValidYearMonthDayNoCache`] | Return `true` if the specified `year`, `month`, and `day` represents a valid date value, and `false` otherwise. Note that valid date values are (as fully defined in the component‐level documentation) in the range `[ 0001/01/01 .. 9999/12/31 ]` (except that `[ 1752/09/03 .. 1752/09/13 ]` are not valid for historical reasons). Also note that this function is guaranteed not to use any date‐cache optimizations. | xref:BloombergLP/bdlt/PosixDateImpUtil/lastDayOfMonth.adoc[`lastDayOfMonth`] | Return the last day of the specified `month` in the specified `year`. The behavior is undefined unless `1 <= year <= 9999` and `1 <= month <= 12`. Note that the value returned will be in the range `[ 28 .. 31 ]`. | xref:BloombergLP/bdlt/PosixDateImpUtil/numLeapYears.adoc[`numLeapYears`] | Return the number of leap years occurring between the specified `year1` and `year2` (inclusive). The behavior is undefined unless `1 <= year1 <= 9999`, `1 <= year2 <= 9999`, and `year1 <= year2`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDay.adoc[`serialToDay`] | Return the day (of the month) of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayNoCache.adoc[`serialToDayNoCache`] | Return the day (of the month) of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. Note that this function is guaranteed not to use any date‐cache optimizations. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayOfWeek.adoc[`serialToDayOfWeek`] | Return, as an integer (with `1 = SUN`, `2 = MON`, ..., and `7 = SAT`), the day (of the week) of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToDayOfYear.adoc[`serialToDayOfYear`] | Return the day of the year of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToMonth.adoc[`serialToMonth`] | Return the month of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToMonthNoCache.adoc[`serialToMonthNoCache`] | Return the month of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. Note that this function is guaranteed not to use any date‐cache optimizations. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYd.adoc[`serialToYd`] | Load, into the specified `year` and `dayOfYear`, the year‐day representation of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYear.adoc[`serialToYear`] | Return the year of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYearNoCache.adoc[`serialToYearNoCache`] | Return the year of the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. Note that this function is guaranteed not to use any date‐cache optimizations. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmd.adoc[`serialToYmd`] | Load, into the specified `year`, `month`, and `day`, the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/serialToYmdNoCache.adoc[`serialToYmdNoCache`] | Load, into the specified `year`, `month`, and `day`, the date value indicated by the specified `serialDay`. The behavior is undefined unless `true == isValidSerial(serialDay)`. Note that this function is guaranteed not to use any date‐cache‐optimizations. | xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDay.adoc[`ydToDay`] | Return the day (of the month) of the date value indicated by the specified `year` and `dayOfYear`. The behavior is undefined unless `true == isValidYearDay(year, dayOfYear)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ydToDayOfWeek.adoc[`ydToDayOfWeek`] | Return, as an integer (with `1 = SUN`, `2 = MON`, ..., and `7 = SAT`), the day (of the week) of the date value indicated by the specified `year` and `dayOfYear`. The behavior is undefined unless `true == isValidYearDay(year, dayOfYear)`. | 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`. The behavior is undefined unless `true == isValidYearDay(year, dayOfYear)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ydToMonth.adoc[`ydToMonth`] | Return the month of the date value indicated by the specified `year` and `dayOfYear`. The behavior is undefined unless `true == isValidYearDay(year, dayOfYear)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ydToSerial.adoc[`ydToSerial`] | Return the serial date representation of the date value indicated by the specified `year` and `dayOfYear`. The behavior is undefined unless `true == isValidYearDay(year, dayOfYear)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToDayOfWeek.adoc[`ymdToDayOfWeek`] | Return, as an integer (with `1 = SUN`, `2 = MON`, ..., and `7 = SAT`), the day (of the week) of the date value indicated by the specified `year`, `month`, and `day`. The behavior is undefined unless `true == isValidYearMonthDay(year, month, day)`. | 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`. The behavior is undefined unless `true == isValidYearMonthDay(year, month, day)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerial.adoc[`ymdToSerial`] | Return the serial date representation of the date value indicated by the specified `year`, `month`, and `day`. The behavior is undefined unless `true == isValidYearMonthDay(year, month, day)`. | xref:BloombergLP/bdlt/PosixDateImpUtil/ymdToSerialNoCache.adoc[`ymdToSerialNoCache`] | Return the serial date representation of the date value indicated by the specified `year`, `month`, and `day`. The behavior is undefined unless `true == isValidYearMonthDay(year, month, day)`. Note that this function is guaranteed not to use any date‐cache optimizations. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#