Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EB3CF1337999 for ; Fri, 26 Nov 2010 14:29:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 03196-03 for ; Fri, 26 Nov 2010 18:28:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from progressive.micfo.com (progressive.micfo.com [174.34.188.2]) by mail.postgresql.org (Postfix) with ESMTP id EAA83133798E for ; Fri, 26 Nov 2010 14:28:54 -0400 (AST) Received: from localhost ([127.0.0.1]:45257 helo=softperience.eu) by progressive.micfo.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PM32S-000780-KN for pgsql-jdbc@postgresql.org; Fri, 26 Nov 2010 12:28:52 -0600 MIME-Version: 1.0 Date: Fri, 26 Nov 2010 12:28:52 -0600 From: =?UTF-8?Q?Rados=C5=82aw_Smogura?= To: Subject: Storing timestamps in text format Message-ID: X-Sender: rsmogura@softperience.eu User-Agent: RoundCube Webmail/0.3.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - progressive.micfo.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - softperience.eu X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/115 X-Sequence-Number: 21236 Hi, I perform following test: 1. Open connection (GMT+1) 2. Change timezone (GMT+3) 3. Write created timestamp. 4. Change timezone to different connection open and write (GMT+4) 5. Read timezone During this I saw driver sends timestamp encoded with initial (in my case +1), form connection open, time zone. It's because TimestampUtils.toString(Calendar, Timestamp) uses defaultCal. Should it use Calendar.getInstance() or new GregorianCalendar? public synchronized String toString(Calendar cal, Timestamp x) { if (cal == null) cal = defaultCal; // = Calendar.getInstance() // new GregorianCalendar() -- ---------- Radosław Smogura http://www.softperience.eu