mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix the string constructor to apply the timezone correctly.
This commit is contained in:
parent
ac515d6ce2
commit
bcedeff3ba
@ -156,9 +156,16 @@ GncDateTimeImpl::GncDateTimeImpl(const std::string str) :
|
|||||||
{
|
{
|
||||||
tzptr = utc_zone;
|
tzptr = utc_zone;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
auto pdt = boost::posix_time::time_from_string(str.substr(0, tzpos));
|
auto pdt = boost::posix_time::time_from_string(str.substr(0, tzpos));
|
||||||
m_time = LDT(pdt, tzptr);
|
m_time = LDT(pdt.date(), pdt.time_of_day(), tzptr,
|
||||||
|
LDTBase::NOT_DATE_TIME_ON_ERROR);
|
||||||
|
}
|
||||||
|
catch(boost::gregorian::bad_year)
|
||||||
|
{
|
||||||
|
throw(std::invalid_argument("The date string was outside of the supported year range."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GncDateTimeImpl::operator time64() const
|
GncDateTimeImpl::operator time64() const
|
||||||
|
Loading…
Reference in New Issue
Block a user