|
Beamlib 3.1.2
This is the Beam C++ class library.
|
This class store a UTC calendar date as a year and a year's day. More...
#include <BDate.h>
Public Member Functions | |
| BDate (int year=0, int month=1, int day=1) | |
| BDate (BString str) | |
| ~BDate () | |
| void | clear () |
| Clear the date/time. More... | |
| void | setFirst () |
| Set the first date available. More... | |
| void | setLast () |
| Set the last date available. More... | |
| void | set (time_t time) |
| Set time using Unix time (seconds from 1970-01-01) More... | |
| void | set (int year=0, int month=1, int day=1) |
| void | setYDay (int year=0, int yday=0) |
| void | setNow () |
| Set the timeStamp to now. More... | |
| int | year () |
| int | yday () |
| int | month () |
| int | day () |
| void | getDate (int &year, int &mon, int &day) |
| BString | getString () |
| Get the time as an ISO date/time string. More... | |
| BString | getStringFormatted (BString format) |
| Gets the time in a string form as per the format. Format syntax as per strftime() More... | |
| BError | setString (BString str) |
| Set the time from an ISO date/time. More... | |
| int | isSet () |
| Check if the date has been set. More... | |
| int | compare (const BDate &date) const |
| Compare two dates. More... | |
| operator BString () | |
| int | operator== (const BDate &date) const |
| int | operator!= (const BDate &date) const |
| int | operator> (const BDate &date) const |
| int | operator>= (const BDate &date) const |
| int | operator< (const BDate &date) const |
| int | operator<= (const BDate &date) const |
Static Public Member Functions | |
| static int | isLeap (int year) |
| static int | daysInMonth (int year, int month) |
Public Attributes | |
| uint16_t | oyear |
| Year (0 .. 65535) More... | |
| uint16_t | oyday |
| Day in year (0 .. 365) More... | |
This class store a UTC calendar date as a year and a year's day.
The BDate class stores a calendar date wit a year and day in the year components. It provides functions to set this date from a string and convert the data to a string as well as BDate comparison functions.
| BDate::BDate | ( | int | year = 0, |
| int | month = 1, |
||
| int | day = 1 |
||
| ) |
| BDate::BDate | ( | BString | str | ) |
| BDate::~BDate | ( | ) |
| void BDate::clear | ( | ) |
Clear the date/time.
| void BDate::setFirst | ( | ) |
Set the first date available.
| void BDate::setLast | ( | ) |
Set the last date available.
| void BDate::set | ( | time_t | time | ) |
Set time using Unix time (seconds from 1970-01-01)
| void BDate::set | ( | int | year = 0, |
| int | month = 1, |
||
| int | day = 1 |
||
| ) |
| void BDate::setYDay | ( | int | year = 0, |
| int | yday = 0 |
||
| ) |
| void BDate::setNow | ( | ) |
Set the timeStamp to now.
| int BDate::year | ( | ) |
| int BDate::yday | ( | ) |
| int BDate::month | ( | ) |
| int BDate::day | ( | ) |
| void BDate::getDate | ( | int & | year, |
| int & | mon, | ||
| int & | day | ||
| ) |
| BString BDate::getString | ( | ) |
Get the time as an ISO date/time string.
Gets the time in a string form as per the format. Format syntax as per strftime()
|
inline |
Check if the date has been set.
| int BDate::compare | ( | const BDate & | date | ) | const |
Compare two dates.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
static |
| uint16_t BDate::oyear |
Year (0 .. 65535)
| uint16_t BDate::oyday |
Day in year (0 .. 365)