mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Enable reading undelimited YYYYMMDDHHMMSS time strings.
For backwards compatibility with 2.4 and 2.6 SQLite3 databases.
This commit is contained in:
parent
2f96b19c77
commit
a17bc85a02
@ -314,8 +314,15 @@ GncDateTimeImpl::GncDateTimeImpl(const std::string str) :
|
|||||||
input_facet->set_iso_extended_format();
|
input_facet->set_iso_extended_format();
|
||||||
PTime pdt(not_a_date_time);
|
PTime pdt(not_a_date_time);
|
||||||
ss >> pdt;
|
ss >> pdt;
|
||||||
|
if (pdt.is_special())
|
||||||
|
{
|
||||||
|
input_facet->format("%Y%m%d%H%M%S");
|
||||||
|
ss.clear(); //Reset to the beginning.
|
||||||
|
ss.seekg(0);
|
||||||
|
ss >> pdt;
|
||||||
|
}
|
||||||
m_time = LDT(pdt.date(), pdt.time_of_day(), tzptr,
|
m_time = LDT(pdt.date(), pdt.time_of_day(), tzptr,
|
||||||
LDTBase::NOT_DATE_TIME_ON_ERROR);
|
LDTBase::NOT_DATE_TIME_ON_ERROR);
|
||||||
}
|
}
|
||||||
catch(boost::gregorian::bad_year)
|
catch(boost::gregorian::bad_year)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user