Re: AGE function - Mailing list pgsql-sql

From Tom Lane
Subject Re: AGE function
Date
Msg-id 27428.1126105981@sss.pgh.pa.us
Whole thread Raw
In response to AGE function  (Louise Catherine <r1c4n@yahoo.com>)
List pgsql-sql
Louise Catherine <r1c4n@yahoo.com> writes:
> When I execute this statement : 
> select AGE(TO_DATE('20041101','yyyymmdd'),
> TO_DATE('19991201','yyyymmdd'))

> at postgre 7.3.3, the result :
>  age                   
>  --------------------- 
>  4 years 11 mons 1 day 

With TimeZone set to 'Asia/Jakarta' on a Linux machine, I can reproduce
that behavior in 7.3.* but not 7.4 and later.  I believe this is the
relevant change:

2004-12-01 14:57  tgl
* src/backend/utils/adt/timestamp.c (REL7_4_STABLE): Fixtimestamptz_age() to do calculation in local timezone not GMT,
perbug1332.
 

and here is a link to the discussion that prompted the change:
http://archives.postgresql.org/pgsql-bugs/2004-12/msg00013.php
        regards, tom lane


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: AGE function
Next
From: Michael Fuhr
Date:
Subject: Re: AGE function