pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: time and timetz : Do I miss something?
Date: Thu, 7 Apr 2011 09:06:26 +0200
Message-ID: <201104071006.27718.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <BANLkTikXntvPp3v_EYvL=7OA60d00r7sPg@mail.gmail.com>
References: <201104051804.18535.achill@matrix.gatewaynet.com>
	<BANLkTikXntvPp3v_EYvL=7OA60d00r7sPg@mail.gmail.com>

Στις Wednesday 06 April 2011 01:38:53 ο/η Oliver Jowett έγραψε:
> On 6 April 2011 03:04, Achilleas Mantzios <achill@matrix.gatewaynet.com> wrote:
> 
> > IMO, the values it gets for the atimestamp  (without tz) and atimestamptz (with tz) are sane.
> > I dont supply any Calendar in getTimestamp for the "without tz" timestamp so the driver correctly assumes
> > we are talking about the local Greek time zone. Correctly 2011-04-05 00:00:00.0 +0300=2011-04-04 21:00:00.0 +0000
> > However i dont quite get the results for atime (without tz) and atimetz (with tz):
> > For atime it correctly prints the time 00:00:00, but the millis should be -10800000, and in hours should be -3.0.
> > For atimetz it incorrectly prints "23:00:00" , but correctly states that the millis=-10800000, and in hours -3.0.
> > Shouldn't at least timetz print the same time as in the case with the timestamptz?
> 
> What were the Greek timezone rules on Jan 1 1970?
> Because that's what it'll be applying (time objects are really just
> Date objects based around Jan 1 1970 - it doesn't work very well as
> you discovered, but blame JDBC for that one..)
> 
> From your results I expect that it was +0200 on Jan 1 1970;
> therefore "00:00:00" == Jan 1, 1970, 00:00:00 locally == Dec 31, 1969,
> 22:00 GMT == -2 hours from the epoch (your 'atime' result)
> and "00:00:00+03" == Jan 1, 1970, 00:00:00 +0300 == Dec 31, 1969,
> 23:00 locally == Dec 31, 1969, 21:00 GMT == -3 hours from the epoch
> (your 'atimetz' result)
> 
> Oliver
> 

It seems so Oliver, thanx.

-- 
Achilleas Mantzios



view thread (3+ messages)

Message-ID: <201104071006.27718.achill@matrix.gatewaynet.com>
Permalink:  ../201104071006.27718.achill@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/201104071006.27718.achill@matrix.gatewaynet.com

 · 

reply

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: achill@matrix.gatewaynet.com
  Subject: Re: time and timetz : Do I miss something?
  In-Reply-To: <201104071006.27718.achill@matrix.gatewaynet.com>
  References: <201104051804.18535.achill@matrix.gatewaynet.com> <BANLkTikXntvPp3v_EYvL=7OA60d00r7sPg@mail.gmail.com> <201104071006.27718.achill@matrix.gatewaynet.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