| 258 | } |
| 259 | |
| 260 | time_t ToTimeT(time_t defaultValue) const { |
| 261 | if (!IsOk()) { |
| 262 | return defaultValue; |
| 263 | } |
| 264 | struct tm tm; |
| 265 | Zero(tm); |
| 266 | tm.tm_year = Year - 1900; |
| 267 | tm.tm_mon = Month - 1; |
| 268 | tm.tm_mday = Day; |
| 269 | tm.tm_hour = Hour; |
| 270 | tm.tm_min = Minute; |
| 271 | tm.tm_sec = Second; |
| 272 | time_t tt = TimeGM(&tm); |
| 273 | if (tt == -1) { |
| 274 | return defaultValue; |
| 275 | } |
| 276 | return tt - ZoneOffsetMinutes * 60; |
| 277 | } |
| 278 | }; |
| 279 | |
| 280 | class TDateTimeParserBaseDeprecated { |