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

Function GetOffset

util/datetime/parser_ut.cpp:131–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 time_t GetOffset(char militaryZone) {
132 char ch = (char)toupper(militaryZone);
133 if (ch == 'Z') {
134 return 0;
135 } else if (ch >= 'A' && ch < 'J') {
136 return (ch - 'A' + 1) * SECONDS_PER_HOUR;
137 } else if (ch > 'J' && ch <= 'M') {
138 return (ch - 'A') * SECONDS_PER_HOUR;
139 } else if (ch >= 'N' && ch <= 'Y') {
140 return -(ch - 'N' + 1) * SECONDS_PER_HOUR;
141 } else {
142 ythrow yexception() << "Invalid military zone.";
143 }
144 }
145
146 void DoTestMilitaryZones(char firstChar, char lastChar) {
147 const time_t utcTime = 1109964885; // Fri, 4 Mar 2005 19:34:45 UT

Callers 3

DoTestMilitaryZonesFunction · 0.70
FindMethod · 0.50
SeekMethod · 0.50

Calls 1

toupperFunction · 0.85

Tested by

no test coverage detected