diff options
author | akhropov <akhropov@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
commit | 298c6da79f1d8f35089a67f463f0b541bec36d9b (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/draft/date.h | |
parent | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (diff) | |
download | ydb-298c6da79f1d8f35089a67f463f0b541bec36d9b.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/draft/date.h')
-rw-r--r-- | util/draft/date.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/util/draft/date.h b/util/draft/date.h index 0e0b1d7a36..e3eb616fe5 100644 --- a/util/draft/date.h +++ b/util/draft/date.h @@ -29,10 +29,10 @@ public: TDate(const char* yyyymmdd); TDate(const TString& yyyymmdd); - TDate(unsigned year, unsigned month, unsigned monthDay); // month from 01, monthDay from 01 + TDate(unsigned year, unsigned month, unsigned monthDay); // month from 01, monthDay from 01 TDate(const TString& date, const TString& format); - - explicit TDate(time_t t); + + explicit TDate(time_t t); time_t GetStart() const { return Timestamp; @@ -54,28 +54,28 @@ public: TDate& operator+=(unsigned days) { Timestamp = GetDateStart(Timestamp + days * SECONDS_IN_DAY + SECONDS_IN_DAY / 2); - return *this; - } - + return *this; + } + TDate& operator-=(unsigned days) { Timestamp = GetDateStart(Timestamp - days * SECONDS_IN_DAY + SECONDS_IN_DAY / 2); - return *this; - } - + return *this; + } + TDate operator+(unsigned days) const { return TDate(Timestamp + days * SECONDS_IN_DAY + SECONDS_IN_DAY / 2); - } - + } + TDate operator-(unsigned days) const { return TDate(Timestamp - days * SECONDS_IN_DAY + SECONDS_IN_DAY / 2); - } - - unsigned GetWeekDay() const; // days since Sunday - - unsigned GetYear() const; + } + + unsigned GetWeekDay() const; // days since Sunday + + unsigned GetYear() const; unsigned GetMonth() const; // from 01 - unsigned GetMonthDay() const; // from 01 - + unsigned GetMonthDay() const; // from 01 + friend bool operator<(const TDate& left, const TDate& right); friend bool operator>(const TDate& left, const TDate& right); friend bool operator<=(const TDate& left, const TDate& right); |