| 9 | #include <util/generic/yexception.h> |
| 10 | |
| 11 | TString Strftime(const char* format, const struct tm* tm) { |
| 12 | size_t size = Max<size_t>(strlen(format) * 2 + 1, 107); |
| 13 | for (;;) { |
| 14 | TTempBuf buf(size); |
| 15 | int r = strftime(buf.Data(), buf.Size(), format, tm); |
| 16 | if (r != 0) { |
| 17 | return TString(buf.Data(), r); |
| 18 | } |
| 19 | size *= 2; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | template <> |
| 24 | TDuration FromStringImpl<TDuration, char>(const char* s, size_t len) { |
no test coverage detected