51 if (nYear == 1899 && nMonth == 12 && nDay == 30)
58bool isValidDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
62 if (nMonth < 1 || 12 < nMonth)
69void convertDaysToDate(sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_Int16& rYear)
87 const sal_Int16 nSign = (nDays <= 0 ? -1 : 1);
94 rYear =
static_cast<sal_Int16
>((nDays / 365) - (
i * nSign));
124 rDay =
static_cast<sal_uInt16
>(nTempDays);
127bool normalize(sal_uInt16& rDay, sal_uInt16& rMonth, sal_Int16& rYear)
132 if (rDay == 0 && rMonth == 0 && rYear == 0)
146 rYear += rMonth / 12;
147 rMonth = rMonth % 12;
constexpr sal_uInt16 getDaysInMonth(sal_uInt16 nMonth, sal_Int16 nYear)
Get number of days in month of year.
constexpr sal_Int32 MAX_DAYS
constexpr bool isLeapYear(sal_Int16 nYear)
Whether year is a leap year.
constexpr sal_Int16 kYearMax
void convertDaysToDate(sal_Int32 nDays, sal_uInt16 &rDay, sal_uInt16 &rMonth, sal_Int16 &rYear)
Obtain date for a days from zero value.
bool isValidDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
Whether date is a valid date.
constexpr sal_Int32 MIN_DAYS
constexpr sal_Int16 kYearMin
constexpr sal_Int32 nNullDateDays
constexpr sal_Int32 YearToDays(sal_Int16 nYear)
Days until start of year from zero, so month and day of month can be added.
constexpr sal_Int32 convertDateToDays(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
Obtain days from zero for a given date, without normalizing.
bool normalize(sal_uInt16 &rDay, sal_uInt16 &rMonth, sal_Int16 &rYear)
Normalize date, i.e.
sal_Int32 convertDateToDaysNormalizing(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
Obtain days from zero for a given date, with normalizing.