hueplusplus
1.0.0
|
Namespace for time/date related classes and functions. More...
Classes | |
class | AbsoluteTime |
One-time, absolute time point. More... | |
class | AbsoluteVariedTime |
class | RecurringTime |
Time repeated weekly to daily, with possible random variation. More... | |
class | TimeInterval |
Time interval repeated daily to weekly. More... | |
class | TimePattern |
Holds different time representations. More... | |
class | Timer |
Timer that is started and triggers after specified delay. More... | |
class | Weekdays |
Any number of days of the week. More... | |
Functions | |
std::string | timepointToTimestamp (std::chrono::system_clock::time_point time) |
Converts a time_point to a timestamp string. More... | |
std::chrono::system_clock::time_point | parseTimestamp (const std::string ×tamp) |
Converts a timestamp to a time_point. More... | |
std::chrono::system_clock::time_point | parseUTCTimestamp (const std::string ×tamp) |
Converts an UTC timestamp to a time_point. More... | |
std::string | durationTo_hh_mm_ss (std::chrono::system_clock::duration duration) |
Converts duration to a time string. More... | |
std::chrono::system_clock::duration | parseDuration (const std::string &hourMinSec) |
Converts time string to a duration. More... | |
Namespace for time/date related classes and functions.
std::string hueplusplus::time::durationTo_hh_mm_ss | ( | std::chrono::system_clock::duration | duration | ) |
Converts duration to a time string.
duration | Duration or time of day to format. Must be less than 24 hours |
hh:mm:ss
HueException | when duration longer than 24 hours. |
system_clock::duration hueplusplus::time::parseDuration | ( | const std::string & | hourMinSec | ) |
Converts time string to a duration.
hourMinSec | Time/duration in the format hh:mm:ss |
std::invalid_argument | when integer conversion fails |
system_clock::time_point hueplusplus::time::parseTimestamp | ( | const std::string & | timestamp | ) |
Converts a timestamp to a time_point.
timestamp | Timestamp from the local time zone in the format YYYY-MM-DD Thh:mm:ss |
std::invalid_argument | when integer conversion fails |
HueException | when time cannot be represented as time_point |
std::chrono::system_clock::time_point hueplusplus::time::parseUTCTimestamp | ( | const std::string & | timestamp | ) |
Converts an UTC timestamp to a time_point.
timestamp | UTC Timestamp the format YYYY-MM-DD Thh:mm:ss |
std::invalid_argument | when integer conversion fails |
HueException | when time cannot be represented as time_point |
std::string hueplusplus::time::timepointToTimestamp | ( | std::chrono::system_clock::time_point | time | ) |
Converts a time_point to a timestamp string.
time | Time to convert |
YYYY-MM-DD
Thh:mm:ss
.Returns the time in the local time zone.
HueException | when time could not be converted |