[GNC-dev] Date format change in prices table?

John Ralls jralls at ceridwen.us
Tue Oct 23 22:30:31 EDT 2018



> On Oct 23, 2018, at 2:17 PM, david <cdweiner at comcast.net> wrote:
> 
> I have been using a home grown Qt - c++ program to process my gnucash sqlite data up until version 3.3.  It appears that the date format stored in the prices table has changed.  I had previously used a string such as "20181015999999" for Oct 15, 2018 and had not had any difficulty in dealing with the gnucash data. Now when I look at the data I see two different formats.  'Old' dates follow the above pattern; but, newer dates look sort of like "2018-09-26 16:"  However, I don't seem to be able to parse the dates stored in this format.  Any help would be greatly appreciated.

GncDateTime(std::string) knows how to handle both formats, so the safest way would be 
   GncDateTime time(time_str);
and if you want a time64,
   auto t64 = static_cast<time64>(time);

Regards,
John Ralls


More information about the gnucash-devel mailing list