Laxkit
0.0.7.1
|
Small class to help slightly with date manipulation, based on the Gregorian calendar. More...
Public Member Functions | |
LaxDate () | |
Initialize to current date. | |
LaxDate (int year, int month, int day) | |
LaxDate (const LaxDate &d) | |
LaxDate & | operator= (LaxDate &d) |
int | Set (int year, int month, int day) |
void | SetToToday () |
int | Year () |
int | Month () |
int | Day () |
int | DayOfWeek () |
Return the number of days after a Sunday. That is, if on a sunday, return 0, monday is 1, etc. | |
int | DayOfYear () |
Protected Attributes | |
int | year |
int | month |
int | day |
int | dayofweek |
int | dayofyear |
Small class to help slightly with date manipulation, based on the Gregorian calendar.
LaxDate will always have a valid date. That is, assuming there are no programming bugs
This class assumes a purely Gregorian calendar, and this ignores the deletion of 10 days in October 1582. In 8000 years or so when the calendar is off by a day, you will be screwed.
If it is an invalid date, then a nonzero value is returned. Else date is set, and 0 is returned.
day starts at 1. Month is in range [1..12]. year can be anything.
References Laxkit::days_in_month().