X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DB7B3529B9 for ; Wed, 20 Jul 2005 15:54:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39608-03 for ; Wed, 20 Jul 2005 18:54:21 +0000 (GMT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by svr1.postgresql.org (Postfix) with ESMTP id D3B4952849 for ; Wed, 20 Jul 2005 15:54:20 -0300 (ADT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j6KIsK23028409 for ; Wed, 20 Jul 2005 14:54:20 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j6KIsKV02795 for ; Wed, 20 Jul 2005 14:54:20 -0400 Received: from vpn83-147.boston.redhat.com (vpn83-147.boston.redhat.com [172.16.83.147]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j6KIsJll028718 for ; Wed, 20 Jul 2005 14:54:20 -0400 From: Vadim Nasardinov Organization: Red Hat / Westford To: pgsql-jdbc@postgresql.org Subject: Re: Timestamp Conversion Woes Redux Date: Wed, 20 Jul 2005 14:58:39 -0400 User-Agent: KMail/1.7.1 References: <90876a9e05071810503606d431@mail.gmail.com> <42DE42E5.6010206@opencloud.com> <90876a9e05072008402337966@mail.gmail.com> In-Reply-To: <90876a9e05072008402337966@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507201458.39779@vadim.nasardinov> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/190 X-Sequence-Number: 13338 On Wednesday 20 July 2005 11:40, Christian Cryder wrote: > b) sending the data across as millisecs value, rather than > flattening to a Timestamp string? That way to could avoid the > toString() issues mentioned above, plus it'd probably be faster to > reconsitute from millis on the server than by parsing a timestamp > string anyways. I learned all sorts of fascinating things by reading this thread: http://forum.java.sun.com/thread.jspa?messageID=2813701 For example: | $ export TZ=Europe/London | $ date +%s -d '19981231 23:59:00' | 915148740 | $ date +%s -d '19990101 00:00:00' | 915148800 | | We can see here that the duration of the last minute in 1998 was 60 | seconds. | | The more or less experimental time zones prefixed by "right/" | accounts for leap seconds: | | $ export TZ=right/Europe/London | $ date +%s -d '19981231 23:59:00' | 915148761 | $ date +%s -d '19990101 00:00:00' | 915148822 | | We see here that the same last minute was 61 seconds long. | | The implementation of Java by Sun does not retrieve the leap | seconds info from the C library. | | As leap second support seems not to have been implemented yet, | every minute in Sun's Java seems to be 60 seconds long. | | But there is no guarantee it won't change in the future, as | permitted in the documentation, and other implementations of Java | can be different, too. Based on this, I get the vague impression that Java's interpretation of milliseconds since epoch may differ from PostgreSQL's interpretation of the same.