Account
| Beamlib 3.3.4 This is the Beam C++ class library. |
A date and time storage class with milisecond resolution and an extra field to indicate a particular sampleNumber it reffers to. More...
#include <BTimeStampMs.h>
Public Member Functions | |
| BTimeStampMs (BString str="") | |
| ~BTimeStampMs () | |
| void | clear () |
| Clear the date/time. | |
| void | setNow () |
| Set the timeStamp to now. | |
| void | setFirst () |
| Set the first date available. | |
| void | setLast () |
| Set the last date available. | |
| void | set (time_t time, int milliSeconds=0) |
| Set time using Unix time (seconds from 1970-01-01) | |
| void | setYDay (int year=0, int yday=0, int hour=0, int minute=0, int second=0, int milliSecond=0) |
| void | setTime (int hour=0, int minute=0, int second=0, int milliSecond=0) |
| BTimeStampMs & | addMilliSeconds (int milliSeconds) |
| Add the given number of milli seconds. This should be less that a year. | |
| BTimeStampMs & | subMilliSeconds (int milliSeconds) |
| Add the given number of milli seconds. This should be less that a year. | |
| BTimeStampMs & | addSeconds (int seconds) |
| Add the given number of seconds. This should be less that a year. | |
| BTimeStampMs & | subSeconds (int seconds) |
| Subtract the given number of seconds. This should be less that a year. | |
| uint32_t | getYearSeconds () |
| Get number of seconds within the year. | |
| uint64_t | getYearMilliSeconds () |
| Get number of seconds within the year. | |
| BString | getString (BString separator="T") |
| Get the time as an ISO date/time string. | |
| BString | getStringNoMs (BString separator="T") |
| Get the time as an ISO date/time string with no ms. | |
| BError | setString (BString dateTime) |
| Set the time from an ISO date/time. | |
| BString | getDurationString (BString separator="T") |
| Get the time as an ISO date/time string but with month's and days starting from 0. | |
| BString | getDurationStringNoMs (BString separator="T") |
| Get the time as an ISO date/time string but with month's and days starting from 0 with no ms. | |
| BError | setDurationString (BString dateTime) |
| Set the time from an ISO date/time string but with month's and days starting from 0. | |
| BString | getStringRaw () |
| void | getDate (int &year, int &mon, int &day) |
| Get the year, month and day. | |
| int | compare (const BTimeStampMs &timeStamp) |
| Compare two dates. | |
| int | operator> (const BTimeStampMs &timeStamp) |
| int | operator>= (const BTimeStampMs &timeStamp) |
| int | operator< (const BTimeStampMs &timeStamp) |
| int | operator<= (const BTimeStampMs &timeStamp) |
Static Public Member Functions | |
| static int | isLeap (int year) |
| static BUInt64 | difference (BTimeStampMs t2, BTimeStampMs t1) |
Public Attributes | |
| uint16_t | year |
| Year (2000 .. 3000) | |
| uint16_t | yday |
| Day in year (0 .. 365) | |
| uint16_t | hour |
| Hour (0 .. 23) | |
| uint16_t | minute |
| Minute (0 .. 59) | |
| uint16_t | second |
| Second (0 .. 59) | |
| uint16_t | milliSecond |
| MilliSecond (0 .. 999) | |
| int32_t | sampleNumber |
| The sample number this time refers to. | |
Detailed Description
A date and time storage class with milisecond resolution and an extra field to indicate a particular sampleNumber it reffers to.
Constructor & Destructor Documentation
◆ BTimeStampMs()
| BTimeStampMs::BTimeStampMs | ( | BString | str = "" | ) |
◆ ~BTimeStampMs()
| BTimeStampMs::~BTimeStampMs | ( | ) |
Member Function Documentation
◆ clear()
| void BTimeStampMs::clear | ( | ) |
Clear the date/time.
◆ setNow()
| void BTimeStampMs::setNow | ( | ) |
Set the timeStamp to now.
◆ setFirst()
| void BTimeStampMs::setFirst | ( | ) |
Set the first date available.
◆ setLast()
| void BTimeStampMs::setLast | ( | ) |
Set the last date available.
◆ set()
| void BTimeStampMs::set | ( | time_t | time, |
| int | milliSeconds = 0 | ||
| ) |
Set time using Unix time (seconds from 1970-01-01)
◆ setYDay()
| void BTimeStampMs::setYDay | ( | int | year = 0, |
| int | yday = 0, | ||
| int | hour = 0, | ||
| int | minute = 0, | ||
| int | second = 0, | ||
| int | milliSecond = 0 | ||
| ) |
◆ setTime()
| void BTimeStampMs::setTime | ( | int | hour = 0, |
| int | minute = 0, | ||
| int | second = 0, | ||
| int | milliSecond = 0 | ||
| ) |
◆ addMilliSeconds()
| BTimeStampMs & BTimeStampMs::addMilliSeconds | ( | int | milliSeconds | ) |
Add the given number of milli seconds. This should be less that a year.
◆ subMilliSeconds()
| BTimeStampMs & BTimeStampMs::subMilliSeconds | ( | int | milliSeconds | ) |
Add the given number of milli seconds. This should be less that a year.
◆ addSeconds()
| BTimeStampMs & BTimeStampMs::addSeconds | ( | int | seconds | ) |
Add the given number of seconds. This should be less that a year.
◆ subSeconds()
| BTimeStampMs & BTimeStampMs::subSeconds | ( | int | seconds | ) |
Subtract the given number of seconds. This should be less that a year.
◆ getYearSeconds()
| uint32_t BTimeStampMs::getYearSeconds | ( | ) |
Get number of seconds within the year.
◆ getYearMilliSeconds()
| uint64_t BTimeStampMs::getYearMilliSeconds | ( | ) |
Get number of seconds within the year.
◆ getString()
◆ getStringNoMs()
Get the time as an ISO date/time string with no ms.
◆ setString()
Set the time from an ISO date/time.
This accepts a string and parses for a supported datetime format string. The function will return an error if it cannot parse a datatime string or if one of the parsed fields is out of range. The conversion supports a fractional second resolution of 1 milisecond resolution rounding the fractional value given to this. Supported formats include: ISO: YYYY-MM-DD[ T]HH:MM:SS.FS.
◆ getDurationString()
Get the time as an ISO date/time string but with month's and days starting from 0.
◆ getDurationStringNoMs()
Get the time as an ISO date/time string but with month's and days starting from 0 with no ms.
◆ setDurationString()
Set the time from an ISO date/time string but with month's and days starting from 0.
◆ getStringRaw()
| BString BTimeStampMs::getStringRaw | ( | ) |
◆ getDate()
| void BTimeStampMs::getDate | ( | int & | year, |
| int & | mon, | ||
| int & | day | ||
| ) |
Get the year, month and day.
◆ compare()
| int BTimeStampMs::compare | ( | const BTimeStampMs & | timeStamp | ) |
Compare two dates.
◆ operator>()
| inline |
◆ operator>=()
| inline |
◆ operator<()
| inline |
◆ operator<=()
| inline |
◆ isLeap()
| static |
◆ difference()
| static |
Member Data Documentation
◆ year
| uint16_t BTimeStampMs::year |
Year (2000 .. 3000)
◆ yday
| uint16_t BTimeStampMs::yday |
Day in year (0 .. 365)
◆ hour
| uint16_t BTimeStampMs::hour |
Hour (0 .. 23)
◆ minute
| uint16_t BTimeStampMs::minute |
Minute (0 .. 59)
◆ second
| uint16_t BTimeStampMs::second |
Second (0 .. 59)
◆ milliSecond
| uint16_t BTimeStampMs::milliSecond |
MilliSecond (0 .. 999)
◆ sampleNumber
| int32_t BTimeStampMs::sampleNumber |
The sample number this time refers to.
The documentation for this class was generated from the following files:
Generated by
