parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
chrono.h File Reference

Cell adapters for std::chrono types. More...

#include <parcel/cell.h>
#include <parcel/defaults.h>
#include <parcel/descriptor.h>
#include <parcel/json.h>
#include <charconv>
#include <chrono>
#include <memory>
#include <string>
#include <string_view>
Include dependency graph for chrono.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  parcel::SystemTimePointCell
 Wall-clock time at second resolution (ISO-8601-friendly). More...
 
class  parcel::UnixMillisCell
 Wall-clock time at millisecond resolution. More...
 
class  parcel::DurationMsCell
 Duration in milliseconds. More...
 
class  parcel::YmdCell
 Calendar date (no time of day). More...
 

Typedefs

using parcel::TimestampMsCell = UnixMillisCell
 Wire-shape alias of UnixMillisCell for code that thinks in ms.
 

Detailed Description

Cell adapters for std::chrono types.

Adds three cells for the most common time payloads:

  • UnixMillisCellsys_time<milliseconds>, wire is i64 ms epoch.
  • DurationMsCellstd::chrono::milliseconds, wire is i64.
  • YmdCellstd::chrono::year_month_day, wire is ISO "YYYY-MM-DD".
  • SystemTimePointCellsys_seconds, wire is i64 epoch seconds.

TimestampMsCell is exposed as an alias of UnixMillisCell for callers who prefer a wire-shape name. The recommended default for cross-language timestamps is UnixMillisCell (matches JavaScript Date.now() and Java Instant.toEpochMilli()).