|
hueplusplus 1.2.0
|
#include <hueplusplus/TimePattern.h>
Inheritance diagram for hueplusplus::time::AbsoluteVariedTime:
Collaboration diagram for hueplusplus::time::AbsoluteVariedTime:Public Member Functions | |
| AbsoluteVariedTime (clock::time_point baseTime, clock::duration variation=std::chrono::seconds(0)) | |
| Create absolute time point. | |
| clock::duration | getRandomVariation () const |
| Get random variation or zero. | |
| std::string | toString () const |
| Get formatted string as expected by Hue API. | |
Public Member Functions inherited from hueplusplus::time::AbsoluteTime | |
| AbsoluteTime (clock::time_point baseTime) | |
| Create absolute time point. | |
| clock::time_point | getBaseTime () const |
| Get base time point. | |
| std::string | toString () const |
| Get formatted string as expected by Hue API. | |
Static Public Member Functions | |
| static AbsoluteVariedTime | parse (const std::string &s) |
| Parse AbsoluteTime from formatted string in local timezone. | |
Static Public Member Functions inherited from hueplusplus::time::AbsoluteTime | |
| static AbsoluteTime | parse (const std::string &s) |
| Parse AbsoluteTime from formatted string in local timezone. | |
| static AbsoluteTime | parseUTC (const std::string &s) |
| Parse AbsoluteTime from formatted UTC string. | |
One-time, absolute time point with possible random variation
Can be either used to represent a specific date and time, or a date and time with a random variation.
|
explicit |
Create absolute time point.
| baseTime | Absolute time point |
| variation | Random variation, optional. When not zero, the time is randomly chosen between baseTime - variation and baseTime + variation |
| system_clock::duration hueplusplus::time::AbsoluteVariedTime::getRandomVariation | ( | ) | const |
Get random variation or zero.
The time can vary up to this amount in both directions.
|
static |
Parse AbsoluteTime from formatted string in local timezone.
| s | Timestamp in the same format as returned by toString() |
s | std::string hueplusplus::time::AbsoluteVariedTime::toString | ( | ) | const |
Get formatted string as expected by Hue API.
YYYY-MM-DDThh:mm:ss YYYY-MM-DDThh:mm:ssAhh:mm:ss with base time first, variation second