/** nDay and nMonth both must be <100, nYear must be != 0 */
Date( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear )
{ setDateFromDMY(nDay, nMonth, nYear); }
void SetDate( sal_Int32 nNewDate );
sal_Int32 GetDate() const { return mnDate; } /** Type safe access for values that are guaranteed to be unsigned, like Date::SYSTEM. */
sal_uInt32 GetDateUnsigned() const { returnstatic_cast<sal_uInt32>(mnDate < 0 ? -mnDate : mnDate); }
css::util::Date GetUNODate() const { return css::util::Date(GetDay(), GetMonth(), GetYear()); }
/** nNewDay must be <100 */ void SetDay( sal_uInt16 nNewDay ); /** nNewMonth must be <100 */ void SetMonth( sal_uInt16 nNewMonth ); /** nNewYear must be != 0 */ void SetYear( sal_Int16 nNewYear );
sal_uInt16 GetDay() const
{ return mnDate < 0 ? static_cast<sal_uInt16>(-mnDate % 100) : static_cast<sal_uInt16>( mnDate % 100);
}
sal_uInt16 GetMonth() const
{ return mnDate < 0 ? static_cast<sal_uInt16>((-mnDate / 100) % 100) : static_cast<sal_uInt16>(( mnDate / 100) % 100);
}
sal_Int16 GetYear() const { returnstatic_cast<sal_Int16>(mnDate / 10000); } /** Type safe access for values that are guaranteed to be unsigned, like Date::SYSTEM. */
sal_uInt16 GetYearUnsigned() const { returnstatic_cast<sal_uInt16>((mnDate < 0 ? -mnDate : mnDate) / 10000); }
sal_Int16 GetNextYear() const { sal_Int16 nY = GetYear(); return nY == -1 ? 1 : nY + 1; }
sal_Int16 GetPrevYear() const { sal_Int16 nY = GetYear(); return nY == 1 ? -1 : nY - 1; }
/** Add years skipping year 0 and truncating at limits. If the original datewasonFeb-29andtheresultingdateisnotaleapyear,the resultisadjustedtoFeb-28.
*/ void AddYears( sal_Int16 nAddYears );
/** Add months skipping year 0 and truncating at limits. If the original datewasonFeb-29orday31andtheresultingdateisnotaleapyear oramonthwithfewerdays,theresultisadjustedtoFeb-28orday30.
*/ void AddMonths( sal_Int32 nAddMonths );
/** Add days skipping year 0 and truncating at limits.
*/ void AddDays( sal_Int32 nAddDays );
/** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31) dependingonmonth/year)ANDisoftheGregoriancalendar(1582-10-15 <=date)
*/ bool IsValidAndGregorian() const;
/** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31)
depending on month/year) */ bool IsValidDate() const;
// Returns true, if the date is the end of the month, false otherwise. bool IsEndOfMonth() const;
/** Normalize date, invalid day or month values are adapted such that they carryovertothenextmonthor/andyear,forexample1999-02-32 becomes1999-03-04,1999-13-01becomes2000-01-01,1999-13-42becomes 2000-02-11.Truncatesat-32768-01-01or32767-12-31,0001-00-xwill yieldthenormalizedvalueof-0001-12-x
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.