The IBPP::Date class represents a date value. It is not an interface class, with automatic smart pointer management like for instance the Database class. It is a plain classical C++ class. Use it to interact easily with DATE (SQL) columns in your databases.
See the file ibpp.h for an up-to-date definition.
A Date is internally made of a simple integer, representing the numbers of days elapsed since the 31 december 1899 (which means the 1 january 1900 value is 1). Being made only of an integer as its data part, the class Date is a light object which you can use without fear of bulky data structures.
Resets the date to an invalid value (actually -1), effectively clearing the value.
Sets the date to today's date.
Sets the date based on the numeric values of the year, month and day. Any invalid values will lead to an invalid date value (-1).
Sets the date based on a integer value, as the one internally stored in the date object itself. See the int GetDate() method too.
Gets a date in its basic components year, month, day.
Returns the internal integer representing the date value.
Returns the year, month, day value of the Date.
Add days to a date. The new date is the original one, 'days' later. This of course takes care of everything, overlapping months and years, months or different numbers of days, leap years,…
Adjust a date to the first day of the same month.
Adjust a date to the last day of the same month, taking into consideration months of varying number of days, including leap years support.
The default constructructor builds an empty date (invalid value), same as if Clear() was called on an existing date.
Similarly to the SetDate(int) method, this form of the constructor builds a date out of the internal representation of another one.
Similarly to the SetDate(int, int, int) method, this form of the constructor builds a date our of its basic components (year, month, day).
Ordinary copy constructor. To make the Date a good citizen of your code.
To assign a date from another one.
To assign a date from the date portion of a Timestamp object.
To compare two Dates for equality.
To compare if one Date is strictly 'lower' (the date is before) the other.