| 256 | } |
| 257 | |
| 258 | void 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 | |
| 264 | void DateToString(char* buf, time_t when, long* sec) { |
| 265 | struct tm theTm; |
no test coverage detected