Remove (unused because of an error) parse-to-tm string timespec construction.

This commit is contained in:
John Ralls
2017-12-12 11:48:11 -08:00
parent 6db0820771
commit 1c8c53a861

View File

@@ -395,33 +395,9 @@ GncSqlColumnTableEntryImpl<CT_TIMESPEC>::load (const GncSqlBackend* sql_be,
{
try
{
constexpr size_t datelen = 14;
auto val = row.get_string_at_col(m_col_name);
if (val.length() == datelen && val != "0000-00-00 00:00:00")
{
using std::stoi;
#ifdef HAVE_STRUCT_TM_GMTOFF
const struct tm tm
{stoi(val.substr(12, 2)), stoi(val.substr(10, 2)),
stoi(val.substr(8, 2)), stoi(val.substr(6, 2)),
stoi(val.substr(4, 2)) - 1, stoi(val.substr(0, 4)) - 1900,
0, 0, 0, 0, nullptr};
#else
const struct tm tm
{stoi(val.substr(12, 2)), stoi(val.substr(10, 2)),
stoi(val.substr(8, 2)), stoi(val.substr(6, 2)),
stoi(val.substr(4, 2)) - 1, stoi(val.substr(0, 4)) -1900,
0, 0, 0};
#endif
GncDateTime time(tm);
ts.tv_sec = static_cast<time64>(time);
}
else
{
GncDateTime time(val);
ts.tv_sec = static_cast<time64>(time);
}
GncDateTime time(val);
ts.tv_sec = static_cast<time64>(time);
}
catch (std::invalid_argument)
{