MCPcopy Create free account
hub / github.com/catboost/catboost / ToTimeT

Method ToTimeT

util/datetime/parser.h:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 time_t ToTimeT(time_t defaultValue) const {
92 if (!IsOk()) {
93 return defaultValue;
94 }
95 struct tm tm;
96 Zero(tm);
97 tm.tm_year = Year - 1900;
98 tm.tm_mon = Month - 1;
99 tm.tm_mday = Day;
100 tm.tm_hour = Hour;
101 tm.tm_min = Minute;
102 tm.tm_sec = Second;
103 time_t tt = TimeGM(&tm);
104 if (tt == -1) {
105 return defaultValue;
106 }
107 return tt - ZoneOffsetMinutes * 60;
108 }
109};
110
111class TDateTimeParserBase {

Callers

nothing calls this directly

Calls 3

IsOkFunction · 0.85
ZeroFunction · 0.85
TimeGMFunction · 0.85

Tested by

no test coverage detected