FBase | +----FDate
#include <Flek/FDate.H>
FDate provides a date class that stores the day, month and year.
FDate::FDate();
Default constructor.FDate::FDate(int y, int m, int d);
Three argument constructor. Initializes this object with the year, month and day.Parameters
y The year. m The month. d The day. FDate::FDate(const FDate& src);
Copy constructor.Parameters
src The FDate object to copy initial values from.
void FDate::day(int d);
Sets the day.Parameters
d The day of the month to associate with this object. int FDate::day();
Gets the day.Return Value
The day of the month associated with this object.
static int FDate::day_of_epoch(int y, int m, int d);
Gets the day of the epoch for the passed date.Parameters
y The year. m The month, 1 through 12. d The day, 1 through the numbers of days in that month. Return Value
The day of the epoch.int FDate::day_of_epoch();
Gets the day of the epoch for this date.Return Value
The day of the epoch.
static int FDate::day_of_week(int y, int m, int d);
Gets the day of the week for the passed date.Parameters
y The year. m The month, 1 through 12. d The day, 1 through the numbers of days in that month. Return Value
The day of the week, 1 through 7.int FDate::day_of_week();
Gets the day of the week for this date.Return Value
The day of the week, 1 through 7.
static int FDate::day_of_year(int y, int m, int d);
Gets the day of the year for the passed date.Parameters
y The year. m The month, 1 through 12. d The day, 1 through the numbers of days in that month. Return Value
The day of the year.int FDate::day_of_year();
Gets the day of the year for this date.Return Value
The day of the year.
static int FDate::days_in_month(int m, int leap);
Gets the number of days in the month for a given month and leap value.Parameters
m The month, 1 through 12. leap Should be 1 if the associated year is a leap year, 0 otherwise. Return Value
The number of days in the month.int FDate::days_in_month();
Gets the number of days in the month for this date.Return Value
The number of days in the month.
bool FDate::end_of_month(int d);
ostream operator. Gets wether day d is at the end of the month.Parameters
d The day to check. Return Value
True if d is at the end of the month. False otherwise.
double FDate::julian_date();
Gets the Julian date.Return Value
The julian date value for this object.
static bool FDate::leap_year(int y);
Gets wether year y is a leap year.Parameters
y The year to check. Return Value
True if the year is a leap year. False otherwise.bool FDate::leap_year();
Gets wether the year associated with this object is a leap year.Return Value
True if the year is a leap year. False otherwise.
void FDate::month(int m);
Sets the month.Parameters
m The month to associate with this object. int FDate::month();
Gets the month.Return Value
The month associated with this object.
void FDate::next_month();
Increment the date by one month.
void FDate::next_year();
Increment the date by one year.
bool FDate::operator!=(const FDate& src);
Inequality comparison of two dates.Parameters
src The FDate object to compare this one to. Return Value
True if this object and src are not equal. False otherwise.
FDate &FDate::operator++();
Pre-increment operator. Increment the date by one day.FDate FDate::operator++(int);
Post-increment operator. Increment the date by one day.
const FDate &FDate::operator+=(int d);
Adds days to the date.Parameters
d The number of days to add to this date.
bool FDate::operator<(const FDate& src);
Comparison of two dates.Parameters
src The FDate object to compare this one to. Return Value
True if this FDate object is less than the src object. False otherwise.
void FDate::operator=(const FDate& src);
Sets one date equal to another date.Parameters
src The FDate object to set values from.
bool FDate::operator==(const FDate& src);
Equality comparison of two dates.Parameters
src The FDate object to compare this one to. Return Value
True if this object and src are equal. False otherwise.
bool FDate::operator>(const FDate& src);
Comparison of two dates.Parameters
src The FDate object to compare this one to. Return Value
True if this FDate object is greater than the src object. False otherwise.
void FDate::previous_month();
Decrement the date by one month.
void FDate::previous_year();
Decrement the date by one year.
void FDate::set_date(int y, int m, int d);
Sets the date from the year, month, and day.Parameters
y The year. m The month, 1 through 12. d The day, 1 through the numbers of days in that month. void FDate::set_date(const FDate& src);
Sets the date value from another FDate object.Parameters
src The FDate object to set values from.
void FDate::set_format(int fmt);
Sets the date format.Parameters
fmt The date format.
char* FDate::to_string(int fmt);
Convert the date to a string.Parameters
fmt The format to use during conversion. char* FDate::to_string();
Convert the date to a string using the current format.
void FDate::today();
Set the date value to today's date.
static bool FDate::valid(int y, int m, int d);
Gets wether the passed date is valid.Parameters
y The year. m The month, 1 through 12. d The day, 1 through the numbers of days in that month. Return Value
True if the year, month and day make a valid date. False otherwise.bool FDate::valid();
Gets wether the current date is valid.Return Value
True if the year, month and day make a valid date. False otherwise.
void FDate::year(int);
Sets the year.Parameters
y The year to associate with this object. int FDate::year();
Gets the year.Return Value
The year associated with this object.