| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A small, dependency-free C++ library for working with calendar dates.
This library provides simple and safe utilities for date subtraction, date addition, and common date queries, with correct handling of leap years and month/year boundaries.
Working with dates is deceptively complex. This project was created to:
date-utils-cpp/
├── src/
│ ├── date_utils.h # Date structures & declarations
│ ├── date_utils.cpp # Date utility implementations
│ └── main.cpp # Usage examples / testing
├── date-utils-cpp.sln
├── .gitignore
└── README.md
#include <iostream>
#include "date_utils.h"
int main() {
sDate d{29, 2, 2024};
decreaseDateByOneDay(d);
increaseDateByOneDay(d);
std::cout << dayName(calculateIndex(d.day, d.month, d.year)) << std::endl;
std::cout << "Weekend: " << isWeekEnd(d) << std::endl;
std::cout << "Days till end of month: " << calcEndOfMonth(d) << std::endl;
}All functionality is demonstrated in main.cpp and covers:
MIT License — free to use, modify, and distribute.
---
| Back | FazBrowse Home | New Git URL |