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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Carol & David Weiner
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.

David Weiner

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

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

John Ralls-2


> On Oct 23, 2018, at 2:17 PM, david <[hidden email]> 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
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel