Correct bogus mktime() calls.

This commit is contained in:
Tom Lane 2001-04-03 18:05:53 +00:00
parent ea283f1555
commit 1c68f27877
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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; tmp->tm_sec = tm->tm_sec;
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE) #if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tmp->tm_year -= 1900;
tmp->tm_mon -= 1;
tmp->tm_isdst = -1; tmp->tm_isdst = -1;
mktime(tmp); mktime(tmp);
tm->tm_isdst = tmp->tm_isdst; tm->tm_isdst = tmp->tm_isdst;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{ {
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE) #if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tm->tm_isdst = -1;
tm->tm_year -= 1900; tm->tm_year -= 1900;
tm->tm_mon -= 1; tm->tm_mon -= 1;
tm->tm_isdst = -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 (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{ {
#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE) #if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tm->tm_isdst = -1;
tm->tm_year -= 1900; tm->tm_year -= 1900;
tm->tm_mon -= 1; tm->tm_mon -= 1;
tm->tm_isdst = -1; tm->tm_isdst = -1;