Loading...
Searching...
No Matches
hueplusplus::time::AbsoluteTime Class Reference

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

`#include <hueplusplus/TimePattern.h>`

Inheritance diagram for hueplusplus::time::AbsoluteTime:
[legend]

## Public Member Functions

| 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 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.

## 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

  baseTime | Absolute 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

  s | Timestamp 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

  s | Timestamp 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-DD` T `hh:mm:ss` in local timezone

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

- include/hueplusplus/TimePattern.h
- src/TimePattern.cpp