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

Represents a local date.

Constructors, destructors, conversion operators

date() defaulted
date(std::string_view str) explicit
Parses a string representation.
date(uint32_t y, uint32_t m, uint32_t d)

Public functions

auto ToString() const -> std::string
Returns "YYYY-mm-dd".
auto IsValid() const -> bool
Returns true if this is a valid date.
auto operator==(const date& other) const -> bool
auto operator!=(const date& other) const -> bool
auto operator<(const date& other) const -> bool
auto operator<=(const date& other) const -> bool
auto operator>(const date& other) const -> bool
auto operator>=(const date& other) const -> bool
auto operator++() -> date&
auto operator--() -> date&

Public variables

uint32_t year
The year.
uint32_t month
The month, from 1-12.
uint32_t day
The day, from 1-31.

Friends

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

Function documentation

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

Parses a string representation.

Supported formats are:

  • Y-m-d
  • d.m.Y