hueplusplus  1.0.0
Public Member Functions | Static Public Member Functions | List of all members
hueplusplus::time::AbsoluteTime Class Reference

One-time, absolute time point. More...

#include <hueplusplus/TimePattern.h>

+ Inheritance diagram for hueplusplus::time::AbsoluteTime:

Public Member Functions

 AbsoluteTime (clock::time_point baseTime)
 Create absolute time point. More...
 
clock::time_point getBaseTime () const
 Get base time point. More...
 
std::string toString () const
 Get formatted string as expected by Hue API. More...
 

Static Public Member Functions

static AbsoluteTime parse (const std::string &s)
 Parse AbsoluteTime from formatted string in local timezone. More...
 
static AbsoluteTime parseUTC (const std::string &s)
 Parse AbsoluteTime from formatted UTC string. More...
 

Detailed Description

One-time, absolute time point.

Constructor & Destructor Documentation

◆ AbsoluteTime()

hueplusplus::time::AbsoluteTime::AbsoluteTime ( clock::time_point  baseTime)
explicit

Create absolute time point.

Parameters
baseTimeAbsolute time point

Member Function Documentation

◆ getBaseTime()

system_clock::time_point hueplusplus::time::AbsoluteTime::getBaseTime ( ) const

Get base time point.

Can be used for calculation with other system_clock time_points

◆ parse()

AbsoluteTime hueplusplus::time::AbsoluteTime::parse ( const std::string &  s)
static

Parse AbsoluteTime from formatted string in local timezone.

Parameters
sTimestamp in the same format as returned by toString()
Returns
AbsoluteTime with base time and variation from s

◆ parseUTC()

AbsoluteTime hueplusplus::time::AbsoluteTime::parseUTC ( const std::string &  s)
static

Parse AbsoluteTime from formatted UTC string.

Parameters
sTimestamp in the same format as returned by toString()
Returns
AbsoluteTime with base time and variation from s

◆ toString()

std::string hueplusplus::time::AbsoluteTime::toString ( ) const

Get formatted string as expected by Hue API.

Returns
Timestamp in the format YYYY-MM-DDThh:mm:ss in local timezone

The documentation for this class was generated from the following files: