From: | Pete Forman <pete(dot)forman(at)westerngeco(dot)com> |
---|---|
To: | lockhart(at)fourpalms(dot)org |
Cc: | Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: AW: Re: tinterval - operator problems on AIX |
Date: | 2001-01-12 09:03:40 |
Message-ID: | 14942.51308.622923.866200@kryten.bedford.waii.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thomas Lockhart writes:
> I haven't yet actually fixed the code, but will post patches when
> I've done so (assuming that a fix is possible).
The normalization in this example program which subtracts 34 years
seems to work OK. I've run it on AIX, IRIX, Linux and Solaris. Some
examples follow.
AIX:
$ TZ=PST8PDT ago34 851995921
Local Mon Dec 30 17:32:01 1996 PST PST
1996-12-30T17:32:01, wday=1, yday=364, isdst = 0
UTC Tue Dec 31 01:32:01 1996 PST PST
1996-12-31T01:32:01, wday=2, yday=365, isdst = 0
Local Sun Dec 30 17:32:01 1962 PST PST
1962-12-30T17:32:01, wday=0, yday=363, isdst = 0
UTC Mon Dec 31 01:32:01 1962 PST PST
1962-12-31T01:32:01, wday=1, yday=364, isdst = 0
Linux:
$ TZ=America/Los_Angeles ago34 426475921
Local Thu Jul 07 18:32:01 1983 PDT -0700
1983-07-07T18:32:01, wday=4, yday=187, isdst = 1
UTC Fri Jul 08 01:32:01 1983 GMT +0000
1983-07-08T01:32:01, wday=5, yday=188, isdst = 0
Local Thu Jul 07 18:32:01 1949 PST -0800
1949-07-07T18:32:01, wday=4, yday=187, isdst = 0
UTC Fri Jul 08 02:32:01 1949 GMT +0000
1949-07-08T02:32:01, wday=5, yday=188, isdst = 0
Here is the program. The call to localtime(&t_ago) is redundant and
hence the adjustment of t_ago can be skipped. It is in this program
as a sanity check.
As it stands, this program assumes that the input and resulting date
are in the usual UNIX range of [1901, 2038]. I presume that there is
code in place that checks the range of dates.
Attachment | Content-Type | Size |
---|---|---|
ago34.c | text/plain | 2.2 KB |
unknown_filename | text/plain | 288 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Bartunov | 2001-01-12 09:21:51 | RE: AW: Re: GiST for 7.1 !! |
Previous Message | Valter Mazzola | 2001-01-12 08:48:14 | Re: Pg7.1beta3: connect failed: The DB System is starting up. |