quantumsheep / cpp-date

C++ date library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Date

The purpose of this library is to provide a reliable date implementation for C++. It started because of the outstanding complexity to generate epochs from raw dates.

It provides header-only implementation so nothing to compile, you just need to include date/date.hpp in your code.

Usage

These declarations are simplified for documentation purpose, they may vary in the actual implementation.

Date

Constructors

Creates a date.

Date(size_t day, size_t month, size_t year)

Creates a date from standard's time_point.

Date(std::chrono::system_clock::time_point time)

Static methods

Creates a new date with of current time.

Date::now()

Methods

Convert the date to epoch.

std::chrono::seconds epoch()

Operators

Date > Date
Date < Date

About

C++ date library

License:MIT License


Languages

Language:C++ 100.0%