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

Function OldDate8601

util/datetime/base_ut.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35namespace {
36 inline void OldDate8601(char* buf, size_t bufLen, time_t when) {
37 struct tm theTm;
38 struct tm* ret = nullptr;
39
40 ret = GmTimeR(&when, &theTm);
41
42 if (ret) {
43 snprintf(buf, bufLen, "%04d-%02d-%02dT%02d:%02d:%02dZ", theTm.tm_year + 1900, theTm.tm_mon + 1, theTm.tm_mday, theTm.tm_hour, theTm.tm_min, theTm.tm_sec);
44 } else {
45 *buf = '\0';
46 }
47 }
48} // namespace
49
50Y_UNIT_TEST_SUITE(TestSprintDate) {

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 2

GmTimeRFunction · 0.85
snprintfFunction · 0.50

Tested by

no test coverage detected