diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-17 00:55:37 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-17 00:55:37 +0000 |
| commit | 764f72dc823edb3f8bdf387501ce4c12dedd2369 (patch) | |
| tree | 01838a17f094eb1ac2a0f99102002adbff063605 /src/backend/utils/adt/timestamp.c | |
| parent | 93236b58e088cd2151540528d484da9ad82e48c8 (diff) | |
Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL convention
for the sign of timezone offsets, ie, positive is east from UTC. These
were previously out of step with other operations that accept or show
timezones, such as I/O of timestamptz values.
Diffstat (limited to 'src/backend/utils/adt/timestamp.c')
| -rw-r--r-- | src/backend/utils/adt/timestamp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 6cf4f3667cf..4ee6e953240 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.85 2003/07/04 18:21:13 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.86 2003/07/17 00:55:37 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3080,17 +3080,18 @@ timestamptz_part(PG_FUNCTION_ARGS) switch (val) { case DTK_TZ: - result = tz; + result = -tz; break; case DTK_TZ_MINUTE: - result = tz / 60; - TMODULO(result, dummy, 60e0); + result = -tz; + result /= 60; + FMODULO(result, dummy, 60e0); break; case DTK_TZ_HOUR: - dummy = tz; - TMODULO(dummy, result, 3600e0); + dummy = -tz; + FMODULO(dummy, result, 3600e0); break; case DTK_MICROSEC: |
