From: John Lister <john.lister@kickstone.com>
To: Kris Jurka <books@ejurka.com>
Cc: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unit test patches
Date: Wed, 06 May 2009 22:25:29 +0100
Message-ID: <4A020049.9050702@kickstone.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0905032030060.7980@leary.csoft.net>
References: <49FAC740.1060607@kickstone.com>
<Pine.BSO.4.64.0905031241160.20196@leary.csoft.net>
<49FDDA33.5070009@kickstone.com>
<28431.1241374645@sss.pgh.pa.us>
<49FDEDA2.7040107@kickstone.com>
<Pine.BSO.4.64.0905032030060.7980@leary.csoft.net>
Kris Jurka wrote:
>
>
> On Sun, 3 May 2009, John Lister wrote:
>
>> Ok, call it BST then :) I was trying to avoid confusion....
>>
>
> OK, I get the failures if I set my timezone to 'Europe/London', but
> with your patch applied I get the same failure setting my timezone to
> 'US/Pacific'. I haven't looked to see exactly what's going on, but
> your patch isn't completely right. Can you get something to work for
> both of these cases?
>
OK, i've done some more testing and i'd be grateful if anyone can repeat
this or tell me the fundamental flaw in my logic.... I don't think it
has anything to do with the driver and apologies as i realise that this
is more of a straight java question.. I've rebooted between tests after
changing the timezone, etc to see if that had any effect - which it didn't
Windows XP SP3 - JDK 1.6.0.13.
for all of these i do this first:
Time t=new Time(28862000); // this should be 8:01:02 UTC
Now taking the string of t using toString() i get the following (when
dst is not active i've simply shifted the clock forward 6 months)
CET (GMT+1, DST auto-adjust enabled and not active) - 09:01:02
- This is ok...
CEST (GMT +1, DST auto-adjust enabled and active) - 09:01:02
- Actually Correct as the date part is 1/1/1970 which isn't DST
CET (GMT+1, DST auto-adjust disabled) - 09:01:02
- Again this is ok...
(same for other time zones)
Now the odd bit
Europe/London (DST auto-adjust enabled but not active) - 09:01:02 -
This is wrong, it should be equiv to GMT
Europe/London (DST auto-adjust enabled and active) - 09:01:02 -
This is wrong (DST shouldn't matter as the date part is 1/1/1970)
Europe/London (DST auto-adjust disabled) - 08:01:02
- ok and just GMT as we'd expect
Am i going mad - its been a long day or is something wierd going on?
This is what is causing the problem, the driver sets the time using
toString() as above and inserts the wrong time into the db. BTW the
check for DST when reading back the data in the test is superfluous as
the date associated with the time is always 1/1/1970 as i originally
spotted except I incorrectly assumed the current DST was applied which
it shouldn't be...
Thanks
JOHN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: john.lister@kickstone.com, books@ejurka.com, john.lister-ps@kickstone.com
Subject: Re: Unit test patches
In-Reply-To: <4A020049.9050702@kickstone.com>
References: <49FAC740.1060607@kickstone.com> <Pine.BSO.4.64.0905031241160.20196@leary.csoft.net> <49FDDA33.5070009@kickstone.com> <28431.1241374645@sss.pgh.pa.us> <49FDEDA2.7040107@kickstone.com> <Pine.BSO.4.64.0905032030060.7980@leary.csoft.net> <4A020049.9050702@kickstone.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox