A C++ header-only library providing a compatibility layer for <chrono> features across different C++ standards (C++17, C++20, etc). This project aims to make it easier to write portable time and date code that works seamlessly regardless of the C++ standard version.
- Compatibility wrappers for
<chrono>features - Utilities for working with clocks, time points, and durations
- Support for local time and time zone data (see
tzdata/) - Header-only: just include
compatible_chrono.hpp
- Clone this repository.
- Include
compatible_chrono.hppin your project. - Build your project with your desired C++ standard (C++17, C++20, etc).
Example build (C++17):
# On Windows
cpp17.cmd
# On Unix
./cpp17.shcompatible_chrono.hpp: Main header filemain.cpp: Example usagetest_*.cpp: Unit tests and examplestzdata/: Time zone data files
This project is licensed under the MIT License. See the LICENSE file for details.
- Based on the C++ standard library
<chrono> - Includes time zone data from the IANA Time Zone Database