From 80d6a277c921454d028e088762bb4a4723f9840e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Feb 2003 05:57:45 +0000 Subject: Simplify timezone-handling code per proposal to pghackers: get rid of setting timezone-related variables during transaction start. They were not used anyway in platforms that HAVE_TM_ZONE or HAVE_INT_TIMEZONE, which it appears is *all* the platforms we are currently supporting. For platforms that have neither, we now only support UTC or numeric- offset-from-UTC timezones. --- src/backend/utils/adt/timestamp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/timestamp.c') diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index bb094707a6f..6d63eef7a3b 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.77 2003/01/22 20:44:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.78 2003/02/22 05:57:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -808,11 +808,13 @@ timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn) * later bypass any calls which adjust the tm fields. */ if (HasCTZSet && (tzp != NULL)) + { #ifdef HAVE_INT64_TIMESTAMP dt -= (CTimeZone * INT64CONST(1000000)); #else dt -= CTimeZone; #endif + } time = dt; #ifdef HAVE_INT64_TIMESTAMP @@ -908,9 +910,11 @@ timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn) #endif #else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */ - *tzp = CTimeZone; /* V7 conventions; don't know timezone? */ + *tzp = 0; + /* Mark this as *no* time zone available */ + tm->tm_isdst = -1; if (tzn != NULL) - *tzn = CTZName; + *tzn = NULL; #endif dt = dt2local(dt, *tzp); -- cgit v1.2.3