| 285 | } |
| 286 | |
| 287 | TString YearToString(const struct tm& theTm) { |
| 288 | 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]"); |
| 289 | char buf[16]; |
| 290 | snprintf(buf, 16, "%04d", theTm.tm_year + 1900); |
| 291 | return buf; |
| 292 | } |
| 293 | |
| 294 | TString YearToString(time_t when) { |
| 295 | struct tm theTm; |
no test coverage detected