Namespace for low‐level POSIX‐calendar date conversion utilities.

Synopsis

Declared in <bdlt_posixdateimputil.h>

struct PosixDateImpUtil;

Description

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.

Static Member Functions

Name

Description

isLeapYear

Return true if the specified year is a leap year, and false otherwise. The behavior is undefined unless 1 <= year <= 9999.

isValidSerial

Return whether serialDay is a valid serial date value.

isValidYearDay

Return whether year and dayOfYear form a valid date.

isValidYearMonthDay

Return whether year/`month`/`day` is a valid POSIX calendar date.

isValidYearMonthDayNoCache

Return whether YMD is valid without using the date cache.

lastDayOfMonth

Return the last day of month for the given year and month.

numLeapYears

Return the number of leap years between year1 and year2 inclusive.

serialToDay

Return the day (of the month) of the date value indicated by the specified serialDay. The behavior is undefined unless true == isValidSerial(serialDay).

serialToDayNoCache

Return the day of month for serialDay without using the date cache.

serialToDayOfWeek

Return the day of week (1=SUN .. 7=SAT) for the given serial day.

serialToDayOfYear

Return the day of the year of the date value indicated by the specified serialDay. The behavior is undefined unless true == isValidSerial(serialDay).

serialToMonth

Return the month of the date value indicated by the specified serialDay. The behavior is undefined unless true == isValidSerial(serialDay).

serialToMonthNoCache

Return the month for serialDay without using the date cache.

serialToYd

Load year and day‐of‐year from the given serial day.

serialToYear

Return the year of the date value indicated by the specified serialDay. The behavior is undefined unless true == isValidSerial(serialDay).

serialToYearNoCache

Return the year for serialDay without using the date cache.

serialToYmd

Load year, month, and day from the given serial day.

serialToYmdNoCache

Load YMD from serialDay without using the date cache.

ydToDay

Return the day of month for the given year and day‐of‐year.

ydToDayOfWeek

Return the day of week (1=SUN .. 7=SAT) for year and day‐of‐year.

ydToMd

Load month and day from the given year and day‐of‐year.

ydToMonth

Return the month of the date value indicated by the specified year and dayOfYear. The behavior is undefined unless true == isValidYearDay(year, dayOfYear).

ydToSerial

Return the serial date for the given year and day‐of‐year.

ymdToDayOfWeek

Return the day of week (1=SUN .. 7=SAT) for the given YMD date.

ymdToDayOfYear

Return the day of year for the given year, month, and day.

ymdToSerial

Return the serial date for the given year, month, and day.

ymdToSerialNoCache

Return the serial date for YMD without using the date cache.

Created with MrDocs