Skip site navigation (1) Skip section navigation (2)

Re: Storing timestamps in text format

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Radosław Smogura <rsmogura(at)softperience(dot)eu>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Storing timestamps in text format
Date: 2010-12-01 10:38:41
Message-ID: AANLkTimmW20LLj_aWRv+bLOW=c8wok48zYKOR0KPAWqL@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Fri, Nov 26, 2010 at 1:28 PM, Radosław Smogura
<rsmogura(at)softperience(dot)eu> wrote:
> 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()
>

What do you expect it to do?

>
> --
> ----------
> Radosław Smogura
> http://www.softperience.eu
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Responses

pgsql-jdbc by date

Next:From: Valentine GogichashviliDate: 2010-12-01 11:06:19
Subject: Re: [HACKERS] Improved JDBC driver part 2
Previous:From: Radosław SmoguraDate: 2010-11-30 18:49:03
Subject: Improved JDBC driver part 2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group