aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-04-03 18:05:53 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-04-03 18:05:53 +0000
commit1c68f2787767e4d59bb1986df1cbc33d30d1d31b (patch)
treeb2551a4ba3d267bcd3d507e4e8fe452cc94aa511
parentea283f1555bec49a8fe63037fc030584fc398728 (diff)
downloadpostgresql-1c68f2787767e4d59bb1986df1cbc33d30d1d31b.tar.gz
postgresql-1c68f2787767e4d59bb1986df1cbc33d30d1d31b.zip
Correct bogus mktime() calls.
-rw-r--r--src/backend/utils/adt/datetime.c4
-rw-r--r--src/backend/utils/adt/timestamp.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 8691fa49b91..60346efdcd1 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.62 2001/03/22 03:59:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.63 2001/04/03 18:05:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1120,6 +1120,8 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
tmp->tm_sec = tm->tm_sec;
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
+ tmp->tm_year -= 1900;
+ tmp->tm_mon -= 1;
tmp->tm_isdst = -1;
mktime(tmp);
tm->tm_isdst = tmp->tm_isdst;
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 7a2e6ea8bb0..f4c90dc3723 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.46 2001/03/22 03:59:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.47 2001/04/03 18:05:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1085,7 +1085,6 @@ timestamp_pl_span(PG_FUNCTION_ARGS)
if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
- tm->tm_isdst = -1;
tm->tm_year -= 1900;
tm->tm_mon -= 1;
tm->tm_isdst = -1;
@@ -1727,7 +1726,6 @@ timestamp_trunc(PG_FUNCTION_ARGS)
if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
- tm->tm_isdst = -1;
tm->tm_year -= 1900;
tm->tm_mon -= 1;
tm->tm_isdst = -1;