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 | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (patch) | |
tree | cb7a9f4a92c0d4cc5a86eeed49ad71e810953c1f /util/draft/date.h | |
parent | 83a8efcf3af051e3dd59c00d1d5dafc96412ec1e (diff) | |
download | ydb-00afc96e9c0298054b7386fa7fb9e3cc3d67b974.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 1 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 e3eb616fe5..0e0b1d7a36 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); |