timestamp arithmetic

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: timestamp arithmetic
Date: 2004-12-17 01:17:44
Message-ID: 200412161817.44721.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Note the queries below generate the same result regardless of the timezone input:

% env | grep TZ
PGTZ=CST6CDT
TZ=CST6CDT

% psql -t -c "select version()"
PostgreSQL 8.0.0beta3 on i686-pc-linux-gnu, compiled by GCC 2.96

% psql -t -c "select '1970-01-01 00:00:00+09'::timestamp + '1089352800 seconds'::interval"
2004-07-09 06:00:00

% psql -t -c "select '1970-01-01 00:00:00+03'::timestamp + '1089352800 seconds'::interval"
2004-07-09 06:00:00

% psql -t -c "select '1970-01-01 00:00:00+01'::timestamp + '1089352800 seconds'::interval"
2004-07-09 06:00:00

Ed

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-12-17 01:24:56 Re: timestamp arithmetic
Previous Message Tom Lane 2004-12-17 00:12:46 Re: Checkpoints occur too frequently