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

Function sprint_gm_date

util/datetime/base.cpp:248–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void sprint_gm_date(char* buf, time_t when, long* sec) {
249 struct tm theTm;
250 ::Zero(theTm);
251 GmTimeR(&when, &theTm);
252 DateToString(buf, theTm);
253 if (sec) {
254 *sec = seconds(theTm);
255 }
256}
257
258void DateToString(char* buf, const struct tm& theTm) {
259 Y_ENSURE(0 <= theTm.tm_year + 1900 && theTm.tm_year + 1900 <= 9999, "invalid year " + ToString(theTm.tm_year + 1900) + ", year should be in range [0, 9999]");

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 4

ZeroFunction · 0.85
GmTimeRFunction · 0.85
DateToStringFunction · 0.85
secondsFunction · 0.85

Tested by

no test coverage detected