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

Function DateToString

util/datetime/base.cpp:258–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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]");
260
261 snprintf(buf, DATE_BUF_LEN, "%04d%02d%02d", theTm.tm_year + 1900, theTm.tm_mon + 1, theTm.tm_mday);
262}
263
264void DateToString(char* buf, time_t when, long* sec) {
265 struct tm theTm;

Callers 2

sprint_gm_dateFunction · 0.85
Y_UNIT_TESTFunction · 0.85

Calls 4

localtime_rFunction · 0.85
secondsFunction · 0.85
ToStringFunction · 0.50
snprintfFunction · 0.50

Tested by

no test coverage detected