werkzeugkiste::config::time_offset struct
#include <types.h>

Represents a time zone offset.

Note that time_offset cannot represent the unknown local offset convention (according to RFC 3339, i.e. it cannot distinguish between -00:00 and +00:00.

Constructors, destructors, conversion operators

time_offset() defaulted
Default c'tor.
time_offset(int32_t m) explicit
time_offset(std::string_view str) explicit
Parses a string representation.
time_offset(int32_t h, int32_t m)

Public functions

auto ToString() const -> std::string
Returns "Z" or "+/-HH:MM".
auto operator==(const time_offset& other) const -> bool
auto operator!=(const time_offset& other) const -> bool
auto operator<(const time_offset& other) const -> bool
auto operator<=(const time_offset& other) const -> bool
auto operator>(const time_offset& other) const -> bool
auto operator>=(const time_offset& other) const -> bool

Public variables

int32_t minutes
The offset from UTC+00:00 in minutes.

Friends

auto operator<<(std::ostream& os, const time_offset& t) -> std::ostream&
Overloaded stream operator.

Function documentation

werkzeugkiste::config::time_offset::time_offset(std::string_view str) explicit

Parses a string representation.

Supported formats are:

  • Z, i.e. the 0 offset.
  • [+-]?HH:MM