[GNC] Working with dates in Postgresql DB

finfort at gmail.com finfort at gmail.com
Tue Apr 28 18:43:12 EDT 2020


Hi,

I have found a strange thing trying to create my report with SQL queries 
from Postgresql Gnucash database.

The column post_date in transactions table stores values in timestamp 
format (YYYY-MM-DD hh:mm:ss).

If I compare the post date in the transaction inside Gnucash program and 
in Postgresql database, I see this:

Gnucash program            Postgresql DB

31/12/2017                        2017-12-31 00:00:00

31/12/2017                        2017-12-31 10:59:00

01/01/2018                        2017-12-31 22:00:00

---------------------------------------------------------------

02/01/2018                        2018-01-01 22:00:00

02/01/2018                        2018-01-02 10:59:00

--------------------------------------------------------------

31/12/2018                        2018-12-30 22:00:00

31/12/2018                        2018-12-31 10:59:00

So, the same dates in DB can be different dates in Gnucash program and 
vise versa.

There are only 00:00:00, 10:59:00, 21:00:00, 22:00:00 values of time.

Please explain how this mystics work and what is the reason to save 
dates like this...

I cannot make my reports without correct converting of dates.

Regards,

Dimon.




More information about the gnucash-user mailing list