Laxkit  0.0.7.1
Public Member Functions | Protected Attributes
Laxkit::LaxDate Class Reference

Small class to help slightly with date manipulation, based on the Gregorian calendar. More...

List of all members.

Public Member Functions

 LaxDate ()
 Initialize to current date.
 LaxDate (int year, int month, int day)
 LaxDate (const LaxDate &d)
LaxDateoperator= (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

Detailed Description

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.


Member Function Documentation

int Laxkit::LaxDate::Set ( int  y,
int  m,
int  d 
)

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().


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:59, Laxkit