Cockatrice 2026-06-27-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
days_years_between.h
Go to the documentation of this file.
1#ifndef COCKATRICE_DAYS_YEARS_BETWEEN_H
2#define COCKATRICE_DAYS_YEARS_BETWEEN_H
3
4#include <QDateTime>
5
6inline static QPair<int, int> getDaysAndYearsBetween(const QDate &then, const QDate &now)
7{
8 int years = now.addDays(1 - then.dayOfYear()).year() - then.year(); // there is no yearsTo
9 int days = then.addYears(years).daysTo(now);
10 return {days, years};
11}
12
13#endif // COCKATRICE_DAYS_YEARS_BETWEEN_H
static QPair< int, int > getDaysAndYearsBetween(const QDate &then, const QDate &now)
Definition days_years_between.h:6