userver: userver/utils/datetime/cpp_20_calendar.hpp File Reference
Loading...
Searching...
No Matches
cpp_20_calendar.hpp File Reference

Detailed Description

This file brings date.h into utils::datetime::date namespace, which is std::chrono::operator/ (calendar) in c++20.

Definition in file cpp_20_calendar.hpp.

Go to the source code of this file.

#include <chrono>
#include <ratio>
#include <date/date.h>
#include <userver/utils/assert.hpp>
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  utils
 Utilities.
 
namespace  utils::datetime
 Date and time utilities.
 

Typedefs

using utils::datetime::Days = date::days
 
using utils::datetime::DaysTimepoint = date::sys_days
 

Functions

constexpr Days utils::datetime::DaysBetweenYears (int from, int to)
 Calculates the number of days between January 1, 00:00 of two years accounting for leap years.
 
constexpr date::day utils::datetime::DaysInMonth (int month, int year)
 Get the number of days in the given month of a given year.