43 CivilTime(int32_t y, uint8_t mo, uint8_t d, uint8_t h = 0, uint8_t mi = 0, uint8_t s = 0,
52 return CivilTime(c.year, c.month, c.day, c.hour, c.minute, c.second, c.nanosecond);
58 const char prev = os.fill();
59 os << u.
year <<
'-' << std::setfill(
'0') << std::setw(2) <<
static_cast<int>(u.
month) <<
'-'
60 << std::setw(2) <<
static_cast<int>(u.
day) <<
' ' << std::setw(2) <<
static_cast<int>(u.
hour)
61 <<
':' << std::setw(2) <<
static_cast<int>(u.
minute) <<
':' << std::setw(2)
62 <<
static_cast<int>(u.
second);
Error handling for the tempoch C++ wrapper.
std::ostream & operator<<(std::ostream &os, const CivilTime &u)
Stream CivilTime as YYYY-MM-DD HH:MM:SS[.nnnnnnnnn].
uint8_t second
Second [0, 60] (60 only during a positive leap second).
static CivilTime from_c(const tempoch_utc_t &c)
Create from the C FFI struct.
uint32_t nanosecond
Nanosecond [0, 999 999 999].
uint8_t month
Month [1, 12].
tempoch_utc_t to_c() const
Convert to the C FFI struct.
uint8_t day
Day of month [1, 31].
uint8_t minute
Minute [0, 59].
int32_t year
Gregorian year (astronomical year numbering).
CivilTime()
Default constructor: J2000 epoch noon-like civil representation.
uint8_t hour
Hour [0, 23].
CivilTime(int32_t y, uint8_t mo, uint8_t d, uint8_t h=0, uint8_t mi=0, uint8_t s=0, uint32_t ns=0)
Construct from civil UTC components.