The dateconv library is a free and open-source C library that provides date conversion between multiple calendar systems, including Persian, Gregorian, Islamic, Hebrew, and Julian calendars.
It supports both shared and static builds on GNU/Linux, macOS, and Windows.
The core date-conversion functions were originally written in JavaScript by John Walker and released into the public domain. The functions were ported to C by Aboutaleb Roshan, with a few minor features added.
This library supports two variants of the Persian calendar:
- Astronomical
- Algorithmic
The algorithmic implementation is based on Ahmad Birashk's proposed algorithm.
This library is in the public domain.
For complete build, test, installation, cleaning, and compiler environment instructions, see BUILDING.md.
Please refer to this guide when compiling the library. It contains the exact commands for every supported workflow and explains how to choose the correct platform, compiler, generator, and shared/static configuration.
| Build system or workflow | Description |
|---|---|
| GNU Make | Uses the standalone project Makefile directly. |
| GNU Autotools | Uses configure.ac, configure, Automake, Libtool, and GNU Make. |
| CMake with Unix Makefiles | Generates Makefiles for GCC or Clang on GNU/Linux and macOS. |
| CMake with MinGW Makefiles | Generates Makefiles for MinGW-w64 on Windows. |
| CMake with Ninja | Generates Ninja build files on GNU/Linux, macOS, and Windows. |
| CMake Presets | Provides predefined Ninja configurations for both, shared-only, and static-only builds. |
| Meson | Supports both, shared-only, and static-only configurations, normally using Ninja as its backend. |
| CMake with NMake | Builds with Microsoft Visual C/C++ and NMake from a Visual Studio developer environment. |
- Both shared and static libraries are supported.
- By default, workflows build both shared and static libraries, unless a more specific option is selected.
- A
testtarget builds the test executable separately. - A
checktarget builds and executes the test.
The source files are signed with the following key:
- abroshan39_PGP_public_key.asc
- Key ID:
B0E5D23797D2D8CB
- Key ID:
If you encounter a bug or unexpected behavior, please send a report to: