Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit aae7b19

Browse files
committed
Update DATEDEBUG removal.
1 parent a8587d0 commit aae7b19

File tree

1 file changed

+3
-8
lines changed
  • src/backend/utils/adt

1 file changed

+3
-8
lines changed

src/backend/utils/adt/dt.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.78 2000/01/02 01:37:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.79 2000/01/02 02:32:37 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -322,7 +322,8 @@ GetEpochTime(struct tm * tm)
322322
tm->tm_min = t0->tm_min;
323323
tm->tm_sec = t0->tm_sec;
324324

325-
tm->tm_year += 1900;
325+
if (tm->tm_year < 1900)
326+
tm->tm_year += 1900;
326327
tm->tm_mon++;
327328

328329
return;
@@ -2310,7 +2311,6 @@ datetime2tm(DateTime dt, int *tzp, struct tm * tm, double *fsec, char **tzn)
23102311

23112312
#ifdef USE_POSIX_TIME
23122313
tx = localtime(&utime);
2313-
#endif
23142314
tm->tm_year = tx->tm_year + 1900;
23152315
tm->tm_mon = tx->tm_mon + 1;
23162316
tm->tm_mday = tx->tm_mday;
@@ -3288,15 +3288,13 @@ DecodeNumber(int flen, char *str, int fmask,
32883288
}
32893289

32903290
tm->tm_year = val;
3291-
32923291
}
32933292
/* already have year? then could be month */
32943293
else if ((fmask & DTK_M(YEAR)) && (!(fmask & DTK_M(MONTH)))
32953294
&& ((val >= 1) && (val <= 12)))
32963295
{
32973296
*tmask = DTK_M(MONTH);
32983297
tm->tm_mon = val;
3299-
33003298
/* no year and EuroDates enabled? then could be day */
33013299
}
33023300
else if ((EuroDates || (fmask & DTK_M(MONTH)))
@@ -3305,14 +3303,12 @@ DecodeNumber(int flen, char *str, int fmask,
33053303
{
33063304
*tmask = DTK_M(DAY);
33073305
tm->tm_mday = val;
3308-
33093306
}
33103307
else if ((!(fmask & DTK_M(MONTH)))
33113308
&& ((val >= 1) && (val <= 12)))
33123309
{
33133310
*tmask = DTK_M(MONTH);
33143311
tm->tm_mon = val;
3315-
33163312
}
33173313
else if ((!(fmask & DTK_M(DAY)))
33183314
&& ((val >= 1) && (val <= 31)))
@@ -3354,7 +3350,6 @@ DecodeNumberField(int len, char *str, int fmask,
33543350
tm->tm_mon = atoi(str + 4);
33553351
*(str + 4) = '\0';
33563352
tm->tm_year = atoi(str + 0);
3357-
33583353
/* yymmdd or hhmmss? */
33593354
}
33603355
else if (len == 6)

0 commit comments

Comments
 (0)