aboutsummaryrefslogtreecommitdiffstats
path: root/util/draft/date.cpp
diff options
context:
space:
mode:
authornkmakarov <nkmakarov@yandex-team.ru>2022-02-10 16:49:06 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:06 +0300
commit324348a37ed08cf66897faefb0ec4bebfe7804e1 (patch)
tree8736a3afd6953763bf57544746bf1b8b5404dec6 /util/draft/date.cpp
parent5eddcf9f19515e4be1e49ba1482d920e007a07d1 (diff)
downloadydb-324348a37ed08cf66897faefb0ec4bebfe7804e1.tar.gz
Restoring authorship annotation for <nkmakarov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/draft/date.cpp')
-rw-r--r--util/draft/date.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/draft/date.cpp b/util/draft/date.cpp
index a290c46050..2ad2989c9e 100644
--- a/util/draft/date.cpp
+++ b/util/draft/date.cpp
@@ -17,23 +17,23 @@ time_t GetDateStart(time_t ts) {
return mktime(&dateTm);
}
-static time_t ParseDate(const char* date, const char* format) {
+static time_t ParseDate(const char* date, const char* format) {
tm dateTm;
memset(&dateTm, 0, sizeof(tm));
if (!strptime(date, format, &dateTm)) {
- ythrow yexception() << "Invalid date string and format: " << date << ", " << format;
+ ythrow yexception() << "Invalid date string and format: " << date << ", " << format;
}
return mktime(&dateTm);
}
-static time_t ParseDate(const char* dateStr) {
+static time_t ParseDate(const char* dateStr) {
if (strlen(dateStr) != 8) {
- ythrow yexception() << "Invalid date string: " << dateStr;
+ ythrow yexception() << "Invalid date string: " << dateStr;
}
-
- return ParseDate(dateStr, "%Y%m%d");
-}
-
+
+ return ParseDate(dateStr, "%Y%m%d");
+}
+
template <>
TDate FromStringImpl<TDate>(const char* data, size_t len) {
return TDate(ParseDate(TString(data, len).data()));
@@ -56,9 +56,9 @@ TDate::TDate(time_t ts)
TDate::TDate(const TString& date, const TString& format)
: Timestamp(GetDateStart(ParseDate(date.data(), format.data())))
-{
-}
-
+{
+}
+
TDate::TDate(unsigned year, unsigned month, unsigned monthDay) {
tm dateTm;
Zero(dateTm);