Fix delta time decoding for 12 AM/PM.
This commit is contained in:
parent
addf9d5f2e
commit
9c800b8e48
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.41 1997/09/20 16:20:29 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.42 1997/10/17 05:36:01 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3036,7 +3036,9 @@ DecodeDateTime(char *field[], int ftype[], int nf,
|
||||
|
||||
if ((mer != HR24) && (tm->tm_hour > 12))
|
||||
return -1;
|
||||
if (mer == PM)
|
||||
if ((mer == AM) && (tm->tm_hour == 12))
|
||||
tm->tm_hour = 0;
|
||||
else if ((mer == PM) && (tm->tm_hour != 12))
|
||||
tm->tm_hour += 12;
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
@ -3205,7 +3207,9 @@ DecodeTimeOnly(char *field[], int ftype[], int nf, int *dtype, struct tm * tm, d
|
||||
|
||||
if ((mer != HR24) && (tm->tm_hour > 12))
|
||||
return -1;
|
||||
if (mer == PM)
|
||||
if ((mer == AM) && (tm->tm_hour == 12))
|
||||
tm->tm_hour = 0;
|
||||
else if ((mer == PM) && (tm->tm_hour != 12))
|
||||
tm->tm_hour += 12;
|
||||
|
||||
if ((fmask & DTK_TIME_M) != DTK_TIME_M)
|
||||
@ -3746,8 +3750,7 @@ DecodeDateDelta(char *field[], int ftype[], int nf, int *dtype, struct tm * tm,
|
||||
}
|
||||
|
||||
/*
|
||||
* read through remaining list backwards to pick up units before
|
||||
* values
|
||||
* read through remaining list backwards to pick up units before values
|
||||
*/
|
||||
for (i = nf - 1; i >= ii; i--)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user