Commit ca23837a authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Fix format to produce actual German style. Affects new "GERMAN" feature only.

parent ed14f885
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.46 1997/12/17 23:22:17 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.47 1997/12/23 19:26:31 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -4122,9 +4122,9 @@ EncodeDateOnly(struct tm * tm, int style, char *str) ...@@ -4122,9 +4122,9 @@ EncodeDateOnly(struct tm * tm, int style, char *str)
case USE_GERMAN_DATES: case USE_GERMAN_DATES:
sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon); sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon);
if (tm->tm_year > 0) if (tm->tm_year > 0)
sprintf((str + 5), "/%04d", tm->tm_year); sprintf((str + 5), ".%04d", tm->tm_year);
else else
sprintf((str + 5), "/%04d %s", -(tm->tm_year - 1), "BC"); sprintf((str + 5), ".%04d %s", -(tm->tm_year - 1), "BC");
break; break;
/* traditional date-only style for Postgres */ /* traditional date-only style for Postgres */
...@@ -4274,12 +4274,12 @@ EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, cha ...@@ -4274,12 +4274,12 @@ EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, cha
-(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC"); -(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC");
break; break;
/* German variant on European style; note mixed delimiters dd.mm/yyyy */ /* German variant on European style */
case USE_GERMAN_DATES: case USE_GERMAN_DATES:
sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon); sprintf(str, "%02d.%02d", tm->tm_mday, tm->tm_mon);
if (tm->tm_year > 0) if (tm->tm_year > 0)
{ {
sprintf((str + 5), "/%04d %02d:%02d:%05.2f", sprintf((str + 5), ".%04d %02d:%02d:%05.2f",
tm->tm_year, tm->tm_hour, tm->tm_min, sec); tm->tm_year, tm->tm_hour, tm->tm_min, sec);
if ((*tzn != NULL) && (tm->tm_isdst >= 0)) if ((*tzn != NULL) && (tm->tm_isdst >= 0))
...@@ -4290,7 +4290,7 @@ EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, cha ...@@ -4290,7 +4290,7 @@ EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, cha
} }
else else
sprintf((str + 5), "/%04d %02d:%02d %s", sprintf((str + 5), ".%04d %02d:%02d %s",
-(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC"); -(tm->tm_year - 1), tm->tm_hour, tm->tm_min, "BC");
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment