From ad4fb0d0d2f33ec0165f2a9a50a6d8cbcef4ab82 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 14 Mar 2012 23:03:34 +0200 Subject: Improve EncodeDateTime and EncodeTimeOnly APIs Use an explicit argument to tell whether to include the time zone in the output, rather than using some undocumented pointer magic. --- src/backend/utils/adt/date.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/date.c') diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c index 85e8fd00ff2..2da4e04a28b 100644 --- a/src/backend/utils/adt/date.c +++ b/src/backend/utils/adt/date.c @@ -1131,7 +1131,7 @@ time_out(PG_FUNCTION_ARGS) char buf[MAXDATELEN + 1]; time2tm(time, tm, &fsec); - EncodeTimeOnly(tm, fsec, NULL, DateStyle, buf); + EncodeTimeOnly(tm, fsec, false, 0, DateStyle, buf); result = pstrdup(buf); PG_RETURN_CSTRING(result); @@ -1918,7 +1918,7 @@ timetz_out(PG_FUNCTION_ARGS) char buf[MAXDATELEN + 1]; timetz2tm(time, tm, &fsec, &tz); - EncodeTimeOnly(tm, fsec, &tz, DateStyle, buf); + EncodeTimeOnly(tm, fsec, true, tz, DateStyle, buf); result = pstrdup(buf); PG_RETURN_CSTRING(result); -- cgit v1.2.3