mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove (unused because of an error) parse-to-tm string timespec construction.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user