date/3.0.1+5

[brief]

A date and time library based on the C++11/14/17 <chrono> header

Build Status Join the chat at https://gitter.im/HowardHinnant/date


Try it out on wandbox!

Summary

This is actually several separate C++11/C++14/C++17 libraries:

  1. "date.h" is a header-only library which builds upon <chrono>. It adds some new duration types, and new time_point types. It also adds "field" types such as year_month_day which is a struct {year, month, day}. And it provides convenient means to convert between the "field" types and the time_point types.

  2. "tz.h" / "tz.cpp" are a timezone library built on top of the "date.h" library. This timezone library is a complete parser of the IANA timezone database. It provides for an easy way to access all of the data in this database, using the types from "date.h" and <chrono>. The IANA database also includes data on leap seconds, and this library provides utilities to compute with that information as well.

  3. "iso_week.h" is a header-only library built on top of the "date.h" library which implements the ISO week date calendar.

  4. "julian.h" is a header-only library built on top of the "date.h" library which implements a proleptic Julian calendar which is fully interoperable with everything above.

  5. "islamic.h" is a header-only library built on top of the "date.h" library which implements a proleptic Islamic calendar which is fully interoperable with everything above.

Standardization

Slightly modified versions of "date.h" and "tz.h" were voted into the C++20 working draft at the Jacksonville FL meeting on 2018-03-17:

Build & Test

The recommended way to use any of these libraries besides "tz.h" is to just include it. These are header-only libraries (except "tz.h").

To use "tz.h", there is a single source file (src/tz.cpp) that needs to be compiled. Here are the recommended directions: https://howardhinnant.github.io/date/tz.html#Installation.

One can run tests by cd'ing into the test subdirectory and running testit. There are known failures on all platforms except for macOS. And even on macOS if C++11 is used. If any of these failures present problems for you, there exist workarounds.

Additionally there is unsupported support for vcpkg and CMake. I don't personally use or maintain these systems as for me they cause more problems than they solve (for this small project). If you would like to contribute to these build systems please feel free to file a PR.

You can download and install Date using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install date

The Date port in vcpkg is updated by Microsoft team members and community contributors. If the version falls behind, please create an issue or pull request on the vcpkg repository.

You can optionally build using CMake. Here is a guide of how to build and test using the CMake Makefile generator.

mkdir build
cd build
cmake -DENABLE_DATE_TESTING=ON -DBUILD_TZ_LIB=ON ../
cmake --build . --target testit # Consider '-- -j4' for multithreading

Projects using this library

If you would like your project (or product) on this list, just let me know.

version 3.0.1+5
license MIT
repository https://pkg.cppget.org/1/stable
download date-3.0.1+5.tar.gz
sha256 81eef6aba947d5bd0a54edb103e6579132130bb9c419eed14a1a03852e5a23e2
project date
url howardhinnant.github.io/date/date.html
doc-url howardhinnant.github.io/date/date.html
src-url github.com/HowardHinnant/date

Depends (1)

libcurl ^7.76.0

Builds

toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_15.0-static_O3
timestamp 2024-03-29 06:40:35 UTC (06:55 minutes ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_15.0-O3
timestamp 2024-03-29 06:39:53 UTC (07:37 minutes ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_15.0
timestamp 2024-03-29 06:39:13 UTC (08:17 minutes ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13-O3
timestamp 2024-03-28 13:22:30 UTC (17:25:00 hours ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13-ndebug_O3
timestamp 2024-03-28 13:22:14 UTC (17:25:16 hours ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13
timestamp 2024-03-28 13:21:43 UTC (17:25:47 hours ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13-static_O3
timestamp 2024-03-28 13:21:19 UTC (17:26:11 hours ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_16.0_llvm_msvc_17.6-static_O2
timestamp 2024-03-27 22:22:27 UTC (01 08:25:04 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-gcc_13_homebrew-static_O3
timestamp 2024-03-27 22:03:15 UTC (01 08:44:15 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-gcc_13_homebrew-O3
timestamp 2024-03-27 22:01:36 UTC (01 08:45:54 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-gcc_13_homebrew
timestamp 2024-03-27 21:56:47 UTC (01 08:50:43 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0_libc++-O3
timestamp 2024-03-27 21:51:33 UTC (01 08:55:57 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0-O3
timestamp 2024-03-27 21:50:24 UTC (01 08:57:06 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0_libc++
timestamp 2024-03-27 21:49:20 UTC (01 08:58:10 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0
timestamp 2024-03-27 21:47:40 UTC (01 08:59:50 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0-static_O3
timestamp 2024-03-27 21:44:51 UTC (01 09:02:39 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_16.0_libc++-static_O3
timestamp 2024-03-27 21:43:31 UTC (01 09:03:59 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_fedora_38-gcc_13-bindist
timestamp 2024-03-27 21:31:24 UTC (01 09:16:06 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_16.0_llvm_msvc_17.6-O2
timestamp 2024-03-27 20:54:59 UTC (01 09:52:31 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_14.0-static_O3
timestamp 2024-03-27 15:54:53 UTC (01 14:52:37 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_14.0-O3
timestamp 2024-03-27 15:53:39 UTC (01 14:53:51 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_14.0
timestamp 2024-03-27 15:53:00 UTC (01 14:54:30 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_16.0_llvm_msvc_17.6
timestamp 2024-03-27 14:39:54 UTC (01 16:07:36 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_15_libc++
timestamp 2024-03-27 13:38:23 UTC (01 17:09:07 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1-ndebug_O3
timestamp 2024-03-27 13:29:32 UTC (01 17:17:58 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1-O3
timestamp 2024-03-27 13:29:03 UTC (01 17:18:27 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1-static_O3
timestamp 2024-03-27 13:28:40 UTC (01 17:18:50 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.6-O2
timestamp 2024-03-27 13:28:22 UTC (01 17:19:08 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1
timestamp 2024-03-27 13:28:19 UTC (01 17:19:11 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.6
timestamp 2024-03-27 13:27:54 UTC (01 17:19:36 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.6-static_O2
timestamp 2024-03-27 13:27:13 UTC (01 17:20:17 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_15.0_msvc_msvc_17.6
timestamp 2024-03-27 13:26:06 UTC (01 17:21:24 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-freebsd13.2
tgt config freebsd_13-clang_14.0-O3
timestamp 2024-03-27 13:25:30 UTC (01 17:22:00 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-freebsd13.2
tgt config freebsd_13-clang_14.0
timestamp 2024-03-27 13:25:25 UTC (01 17:22:06 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_12-bindist
timestamp 2024-03-27 13:24:15 UTC (01 17:23:15 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.5
timestamp 2024-03-27 13:23:37 UTC (01 17:23:53 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-freebsd13.2
tgt config freebsd_13-clang_14.0-static_O3
timestamp 2024-03-27 13:23:25 UTC (01 17:24:05 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_15
timestamp 2024-03-27 13:22:48 UTC (01 17:24:42 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_11-gcc_12
timestamp 2024-03-27 13:22:17 UTC (01 17:25:13 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_15.0_libc++
timestamp 2024-03-27 13:21:50 UTC (01 17:25:40 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_15.0
timestamp 2024-03-27 13:21:27 UTC (01 17:26:03 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-freebsd12.4
tgt config freebsd_12-clang_13.0
timestamp 2024-03-27 13:21:07 UTC (01 17:26:23 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_debian_11-gcc_12.1
timestamp 2024-03-27 13:20:52 UTC (01 17:26:38 days ago)
result success | log | rebuild
toolchain public-0.16.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_12.2_mingw_w64-O2
timestamp 2024-03-27 10:29:23 UTC (01 20:18:07 days ago)
result error (update) | log | rebuild
toolchain public-0.16.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_12.2_mingw_w64
timestamp 2024-03-27 10:29:14 UTC (01 20:18:16 days ago)
result error (update) | log | rebuild
toolchain public-0.16.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_12.2_mingw_w64-static_O2
timestamp 2024-03-27 10:28:56 UTC (01 20:18:34 days ago)
result error (update) | log | rebuild
toolchain public-0.16.0
target x86_64-linux-gnu
tgt config linux_fedora_37-gcc_12.2-bindist
timestamp 2024-03-27 06:35:56 UTC (02 00:11:34 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16_libc++-O3
timestamp 2024-03-26 23:18:46 UTC (02 07:28:44 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16-O3
timestamp 2024-03-26 22:46:33 UTC (02 08:00:57 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16_libc++-static_O3
timestamp 2024-03-26 22:41:00 UTC (02 08:06:30 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16_libc++
timestamp 2024-03-26 22:38:50 UTC (02 08:08:40 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16
timestamp 2024-03-26 22:38:16 UTC (02 08:09:14 days ago)
result success | log | rebuild
toolchain public-0.16.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_16-static_O3
timestamp 2024-03-26 22:29:20 UTC (02 08:18:10 days ago)
result success | log | rebuild