Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. CCTZ

CCTZ

Apache-2.0C++v2.5

A C++ library for translating between absolute and civil times using time zone rules, extending the <chrono> library.

GitHubGitHub
657 stars180 forks0 contributors

What is CCTZ?

CCTZ is a C++ library that extends the C++11 `<chrono>` library to provide comprehensive tools for handling dates, times, and time zones. It solves the problem of correctly converting between absolute time (machine-scale) and civil time (human-scale) using time zone rules, which is crucial for applications dealing with international time representations. The library includes separate components for civil time calculations and time zone conversions based on the IANA time zone database.

Target Audience

C++ developers building applications that require accurate date and time computations across different time zones, such as scheduling systems, logging tools, or international software.

Value Proposition

Developers choose CCTZ because it provides a correct and simple API for time zone conversions that integrates seamlessly with the standard C++ `<chrono>` library, avoiding common pitfalls in time programming. Its separation of civil time and time zone logic ensures reliable handling of complex time zone rules and historical changes.

Overview

CCTZ is a C++ library for translating between absolute and civil times using the rules of a time zone.

Use Cases

Best For

  • Converting between UTC and local times in C++ applications
  • Handling date arithmetic across different time zones
  • Implementing scheduling systems with time zone awareness
  • Logging events with accurate timestamps in distributed systems
  • Displaying times in user interfaces for international audiences
  • Processing historical time data with correct time zone rules

Not Ideal For

  • Windows projects that cannot or prefer not to install IANA zoneinfo files
  • Non-C++ codebases requiring time zone logic (e.g., Python or Java applications)
  • Embedded or resource-constrained systems where external time zone data dependencies are prohibitive

Pros & Cons

Pros

Seamless <chrono> Integration

Works directly with C++11's std::chrono for absolute time, making it a natural extension for modern C++ projects without modifying existing code.

Accurate Time Zone Rules

Uses the IANA time zone database to handle historical changes and daylight saving time correctly, ensuring reliable conversions for international applications.

Header-Only Civil Time

The civil-time library is header-only, allowing easy inclusion for date arithmetic without complex linking or build steps.

Clear Conceptual Separation

Emphasizes the distinction between absolute time, civil time, and time zones, which helps developers avoid common pitfalls in time programming.

Cons

System Zoneinfo Dependency

Requires the IANA time zone database to be installed on the system, which can be absent, outdated, or difficult to manage on some platforms like Windows.

Incomplete Windows Support

On Windows, it relies on manually installed zoneinfo files rather than native APIs, as admitted in the README, making it less integrated for Windows-centric development.

Build Tool Bias

Optimized for Bazel build system, which might not align with all C++ teams' workflows; while CMake is supported, it may require extra configuration.

Frequently Asked Questions

Quick Stats

Stars657
Forks180
Contributors0
Open Issues7
Last commit6 days ago
CreatedSince 2015

Tags

#time-conversion#c-plus-plus-11#time-zone#date-time#c-plus-plus#header-only-library#chrono#cross-platform

Built With

B
Bazel
M
Make
C
CMake
G
Google Test
C
C++

Included in

C/C++70.6k
Auto-fetched 1 day ago

Related Projects

stbstb

stb single-file public domain libraries for C/C++

Stars34,793
Forks8,098
Last commit2 months ago
{fmt}{fmt}

A modern formatting library

Stars25,868
Forks3,082
Last commit2 days ago
xxHashxxHash

Extremely fast non-cryptographic hash algorithm

Stars11,299
Forks920
Last commit1 day ago
single_file_libssingle_file_libs

List of single-file C/C++ libraries, with emphasis on clause-less licenses.

Stars10,024
Forks649
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub