LibBeamApi 0.3.8
|
#include <BTimeStamp.h>
Public Member Functions | |
BTimeStamp () | |
BTimeStamp (int year, int month=1, int day=1, int hour=0, int minute=0, int second=0, int microsecond=0) | |
BTimeStamp (const BString str) | |
~BTimeStamp () | |
void | clear () |
Clear the date/time. | |
void | setFirst () |
Set the first date available. | |
void | setLast () |
Set the last date available. | |
void | set (time_t time, int microSeconds) |
Set time using Unix time (seconds from 1970-01-01) | |
void | set (int year=0, int month=1, int day=1, int hour=0, int minute=0, int second=0, int microsecond=0) |
void | set (const BTimeStampMs &timeStamp) |
Set the timeStamp to given MS time stamp. | |
void | setYDay (int year=0, int yday=0, int hour=0, int minute=0, int second=0, int microsecond=0) |
void | setTime (int hour=0, int minute=0, int second=0, int microsecond=0) |
void | setNow () |
Set the timeStamp to now. | |
int | year () const |
int | yday () const |
int | month () const |
int | day () const |
int | hour () const |
int | minute () const |
int | second () const |
int | microSecond () const |
void | getDate (int &year, int &mon, int &day) const |
BString | getString (BString separator="T") const |
Get the time as an ISO date/time string. | |
BError | setString (const BString dateTime) |
Set the time from an ISO date/time. | |
BString | getStringNoMs (BString separator="T") const |
Get the time as an ISO date/time string without microseconds. | |
BString | getStringFormatted (BString format) const |
Gets the time in a string form as per the format. Format syntax as per strftime() | |
void | addMilliSeconds (int milliSeconds) |
Add the given number of milli seconds. This should be less that a year. | |
void | addMicroSeconds (int64_t microSeconds) |
Add the given number of micro seconds. This should be less that a year. | |
void | addSeconds (int seconds) |
Add the given number of seconds. This should be less that a year. | |
uint32_t | getYearSeconds () const |
Get number of seconds within the year. | |
uint64_t | getYearMicroSeconds () const |
Get number of micro seconds within the year. | |
int | isSet () const |
int | compare (const BTimeStamp &timeStamp) const |
Compare two dates. | |
operator BString () const | |
BTimeStamp & | operator= (const BTimeStampMs &timeStamp) |
int | operator== (const BTimeStamp &timeStamp) const |
int | operator!= (const BTimeStamp &timeStamp) const |
int | operator> (const BTimeStamp &timeStamp) const |
int | operator>= (const BTimeStamp &timeStamp) const |
int | operator< (const BTimeStamp &timeStamp) const |
int | operator<= (const BTimeStamp &timeStamp) const |
Static Public Member Functions | |
static int | isLeap (int year) |
static BInt64 | difference (BTimeStamp t2, BTimeStamp t1) |
Public Attributes | |
uint16_t | oyear |
Year (0 .. 65535) | |
uint16_t | oyday |
Day in year (0 .. 365) | |
uint8_t | ohour |
Hour (0 .. 23) | |
uint8_t | ominute |
Minute (0 .. 59) | |
uint8_t | osecond |
Second (0 .. 59) | |
uint8_t | ospare |
Padding. | |
uint32_t | omicroSecond |
MicroSecond (0 .. 999999) | |
BTimeStamp::BTimeStamp | ( | ) |
BTimeStamp::BTimeStamp | ( | int | year, |
int | month = 1 , |
||
int | day = 1 , |
||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | second = 0 , |
||
int | microsecond = 0 |
||
) |
BTimeStamp::BTimeStamp | ( | const BString | str | ) |
BTimeStamp::~BTimeStamp | ( | ) |
void BTimeStamp::addMicroSeconds | ( | int64_t | microSeconds | ) |
Add the given number of micro seconds. This should be less that a year.
void BTimeStamp::addMilliSeconds | ( | int | milliSeconds | ) |
Add the given number of milli seconds. This should be less that a year.
void BTimeStamp::addSeconds | ( | int | seconds | ) |
Add the given number of seconds. This should be less that a year.
void BTimeStamp::clear | ( | ) |
Clear the date/time.
int BTimeStamp::compare | ( | const BTimeStamp & | timeStamp | ) | const |
Compare two dates.
int BTimeStamp::day | ( | ) | const |
|
static |
void BTimeStamp::getDate | ( | int & | year, |
int & | mon, | ||
int & | day | ||
) | const |
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()
Get the time as an ISO date/time string without microseconds.
uint64_t BTimeStamp::getYearMicroSeconds | ( | ) | const |
Get number of micro seconds within the year.
uint32_t BTimeStamp::getYearSeconds | ( | ) | const |
Get number of seconds within the year.
int BTimeStamp::hour | ( | ) | const |
|
static |
|
inline |
int BTimeStamp::microSecond | ( | ) | const |
int BTimeStamp::minute | ( | ) | const |
int BTimeStamp::month | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int BTimeStamp::second | ( | ) | const |
void BTimeStamp::set | ( | const BTimeStampMs & | timeStamp | ) |
Set the timeStamp to given MS time stamp.
void BTimeStamp::set | ( | int | year = 0 , |
int | month = 1 , |
||
int | day = 1 , |
||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | second = 0 , |
||
int | microsecond = 0 |
||
) |
void BTimeStamp::set | ( | time_t | time, |
int | microSeconds | ||
) |
Set time using Unix time (seconds from 1970-01-01)
void BTimeStamp::setFirst | ( | ) |
Set the first date available.
void BTimeStamp::setLast | ( | ) |
Set the last date available.
void BTimeStamp::setNow | ( | ) |
Set the timeStamp to now.
void BTimeStamp::setTime | ( | int | hour = 0 , |
int | minute = 0 , |
||
int | second = 0 , |
||
int | microsecond = 0 |
||
) |
void BTimeStamp::setYDay | ( | int | year = 0 , |
int | yday = 0 , |
||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | second = 0 , |
||
int | microsecond = 0 |
||
) |
int BTimeStamp::yday | ( | ) | const |
int BTimeStamp::year | ( | ) | const |
uint8_t BTimeStamp::ohour |
Hour (0 .. 23)
uint32_t BTimeStamp::omicroSecond |
MicroSecond (0 .. 999999)
uint8_t BTimeStamp::ominute |
Minute (0 .. 59)
uint8_t BTimeStamp::osecond |
Second (0 .. 59)
uint8_t BTimeStamp::ospare |
Padding.
uint16_t BTimeStamp::oyday |
Day in year (0 .. 365)
uint16_t BTimeStamp::oyear |
Year (0 .. 65535)