TIMESTAMP problem in GnuCash Postgresql backend

Matthew Vanecek mevanecek at yahoo.com
Sun Aug 3 14:28:14 CDT 2003


On Sat, 2003-08-02 at 13:54, Derek Atkins wrote:
> linas at linas.org (Linas Vepstas) writes:
> 
> > > Do y'all think that we should worry about that?  As far as I can tell,
> > > the data is stored properly in the database in all cases--it appears
> > > that it is just the presentation that is messed up. Opinions?
> > 
> > I'm not too concerned, except that the the gmt vs not gmt thing
> > should be clarified & fixed.
> 
> Agreed..
> 
> > I figure that with multiple users, different users might be in 
> > different timezones, so each user should see times in thier own
> > local timezone. 
> 
> IMHO, all dates should be stored in GMT and presented to local time
> for the viewer.  I.e., the user works in local time, the data is
> stored in GMT.  That the XML backend is adding a timezone is, IMHO, a
> bug that should be fixed.
> 

I forgot to mention, the dates that the engine gives to the Postgres
backend are local time dates, not GMT.  If I enter 07/25/2003 in the
register, the backend receives "2003-07-25 00:00:00".  The file backend
assumes (correctly) that 07/25/2003 is a local-time date.  The 

Also, defining the column as "TIMESTAMP WITH TIME ZONE" means that the
inserted date is always stored in local time (e.g., '2003-07-25 
00:00:00+06' is stored as '2003-07-24 13:00:00-05', in my TZ), where
defining "TIMESTAMP" as the column data type strips time zone
information gratuitously ('2003-07-25  00:00:00+06' is stored as
'2003-07-25 00:00:00').

Just some info on the subtleties of SQL time data types....I'd prefer to
keep time zone information stored with the timestamp.
-- 
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/attachments/20030803/3ef44de7/attachment.bin


More information about the gnucash-devel mailing list