Skip to content

A C++ library for handling and manipulating dates, offering features such as formatting, date calculations, comparisons, and validation. It supports adding and subtracting days, months, or years, with error handling for invalid date formats.

License

Notifications You must be signed in to change notification settings

chihebabiza/cpp-date-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Date Library in C++

Overview

This C++ library provides a collection of functions for handling date-related operations, built using object-oriented programming (OOP) principles. It simplifies date manipulations such as formatting, calculations, and comparisons.

Features

  • Get the current date
  • Format date in various styles
  • Add or subtract days, months, or years
  • Compare dates
  • Calculate the difference between two dates
  • Validate a given date
  • Convert between different date formats ...etc

Installation

To use this library in your C++ project:

  1. Clone the repository or download the source files.
  2. Include the necessary header file in your C++ program.
  3. Compile and link the library with your project.
#include "Date.h"

Usage

Here is an example of how to use the library:

#include <iostream>
#include "Date.h"

using namespace std;

int main()
{
    clsDate Date1;
    Date1.Print();
    clsDate Date2("31/1/2022");
    Date2.Print();
    clsDate Date3(20, 12, 2022);
    Date3.Print();
    clsDate Date4(250, 2022);
    Date4.Print();
    Date1.IncreaseDateByOneMonth();
    Date1.Print();


    return 0;
}

Requirements

  • A C++ compiler (GCC, Clang, MSVC, etc.)

Statistics

  • Total Functions: 75
  • Total Lines of Code: 1,104

Contributing

Feel free to contribute by submitting pull requests, reporting issues, or suggesting new features.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Developed by Chiheb Abiza

Contact

For any inquiries, feel free to reach out:

Open Source

This project is open source and welcomes contributions from the community!

About

A C++ library for handling and manipulating dates, offering features such as formatting, date calculations, comparisons, and validation. It supports adding and subtracting days, months, or years, with error handling for invalid date formats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages