gnucash-2.3.1+postgres+postdate

Klaus Dahlke klaus.dahlke at gmx.de
Sat Jun 20 18:18:40 EDT 2009


Hi all,
I am experimenting a bit with the postgres backend. Saving as database, loading and working is fine. One of the reasons why I'd like to use the database backend is to do reporting via SQL or e.g. Rails.

The question I have is regarding the column 'post_date' in table 'transactions'. For some entries it shows some weird values:

gnucash=# select * from transactions where post_date='20061231230000';
               guid               |          currency_guid           | num |   post_date    |   enter_date   | description  
----------------------------------+----------------------------------+-----+----------------+----------------+--------------
 33b94fb54aacb4689dfeb2bfd5837618 | 408b1ad99a33c4d564c97e5fb5177cf2 |     | 20061231230000 | 20070102175105 | Kindergarten


The transaction stems from a schedule transaction for the first of each month, here Jan., 1st 2007. But within the database the date is shown as timestamp in UTC (I live in Germany, UTC+1). Thus, running some analysis on 'post_date' would give me some wrong figures, because the entries would count for a wrong period(year or month).

I would have to add the difference between local time and UTC. It seems that during daylight saving time 2 hours are subtracted. In Germany daylight ends on the last weekend in September, but figures of October show also two hours difference. Is that some hard coded, that the month April incl October have a two hour offset, for the rest it is just one hour or shall the offset be according to the official daylight saving time?

How is the the date conversion handled when reading the database? That would help me to do have my reports in sync with the application. 

Thanks and best regards,
Klaus


More information about the gnucash-user mailing list