aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/adt/nabstime.c12
-rw-r--r--src/backend/utils/adt/timestamp.c10
2 files changed, 20 insertions, 2 deletions
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 434b5c95a83..31117389b0a 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.80 2001/01/24 19:43:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.81 2001/02/13 14:32:52 momjian Exp $
*
* NOTES
*
@@ -205,7 +205,17 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char *tzn)
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
if (tzp != NULL)
+ {
tx = localtime((time_t *) &time);
+# ifdef NO_MKTIME_BEFORE_1970
+ if (tx->tm_year < 70 && tx->tm_isdst == 1)
+ {
+ time -= 3600;
+ tx = localtime((time_t *) &time);
+ tx->tm_isdst = 0;
+ }
+# endif
+ }
else
{
tx = gmtime((time_t *) &time);
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index e3facb7f1e4..a01a790124f 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.44 2001/01/24 19:43:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.45 2001/02/13 14:32:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -315,6 +315,14 @@ timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, double *fsec, char **tzn)
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tx = localtime(&utime);
+# ifdef NO_MKTIME_BEFORE_1970
+ if (tx->tm_year < 70 && tx->tm_isdst == 1)
+ {
+ utime -= 3600;
+ tx = localtime(&utime);
+ tx->tm_isdst = 0;
+ }
+# endif
tm->tm_year = tx->tm_year + 1900;
tm->tm_mon = tx->tm_mon + 1;
tm->tm_mday = tx->tm_mday;