| 246 | } |
| 247 | |
| 248 | void 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 | |
| 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]"); |
no test coverage detected