Skip to main content

tempoch-cpp

Active

Header-only C++17 wrapper for tempoch: Julian Date, MJD, UTC, and Period types for astronomical time.

2 stars
0 forks
C++
AGPL-3.0
Updated today

Why it exists

tempoch-cpp brings the tempoch time model into C++ as ordinary value types. It covers Julian dates, MJD, UTC, and periods without forcing C++ users to think in FFI terms.

Key Features

  • JulianDate and MJD strongly-typed value wrappers
  • UTC civil date-time with nanosecond precision
  • Period intervals with intersection operations
  • Exception-based error model (typed C++ exceptions)
  • CMake integration with automatic Rust FFI build

Getting Started

// CMakeLists.txt
find_package(tempoch_cpp REQUIRED)
target_link_libraries(myapp PRIVATE tempoch::tempoch_cpp)

// main.cpp
#include <tempoch/tempoch.hpp>
using namespace tempoch;

auto jd = JulianDate::from_utc({2026, 1, 1, 0, 0, 0});
auto mjd = MJD::from_jd(jd);
auto utc = jd.to_utc();

Contributing

We welcome contributions! Here's how you can help:

  • 1 Fork the repository and create your branch from main
  • 2 Make your changes and add tests if applicable
  • 3 Ensure all tests pass with cargo test
  • 4 Submit a pull request with a clear description

License

This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.

Latest Release

v0.5.4 Jun 13, 2026
View release notes

Tags

cpp c++17 time astronomy bindings