aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/date.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-07-23 14:25:34 +0000
committerBruce Momjian <bruce@momjian.us>2005-07-23 14:25:34 +0000
commit3dbbbbf8e98329e1eea9920436defc64af3594d3 (patch)
tree38d2b294496f12135a7b01e6d3da99912d72b5bf /src/backend/utils/adt/date.c
parent6c61b0d93cd5378bfb64959b9e738fe02413cefe (diff)
downloadpostgresql-3dbbbbf8e98329e1eea9920436defc64af3594d3.tar.gz
postgresql-3dbbbbf8e98329e1eea9920436defc64af3594d3.zip
Andrew pointed out that the current fix didn't handle dates that were
near daylight savings time boudaries. This handles it properly, e.g. test=> select '2005-04-03 04:00:00'::timestamp at time zone 'America/Los_Angeles'; timezone ------------------------ 2005-04-03 07:00:00-04 (1 row)
Diffstat (limited to 'src/backend/utils/adt/date.c')
-rw-r--r--src/backend/utils/adt/date.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index fdb3942f4ff..477d7993e6f 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.118 2005/07/22 05:03:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.119 2005/07/23 14:25:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -301,7 +301,7 @@ date2timestamptz(DateADT dateVal)
tm->tm_hour = 0;
tm->tm_min = 0;
tm->tm_sec = 0;
- tz = DetermineLocalTimeZone(tm);
+ tz = DetermineTimeZoneOffset(tm, global_timezone);
#ifdef HAVE_INT64_TIMESTAMP
result = dateVal * USECS_PER_DAY + tz * USECS_PER_SEC;
@@ -2231,7 +2231,7 @@ time_timetz(PG_FUNCTION_ARGS)
GetCurrentDateTime(tm);
time2tm(time, tm, &fsec);
- tz = DetermineLocalTimeZone(tm);
+ tz = DetermineTimeZoneOffset(tm, global_timezone);
result = (TimeTzADT *) palloc(sizeof(TimeTzADT));