Content-Length: 256171 | pFad | https://github.com/postgrespro/postgres/commit/9b43d73b3f9bef276a46660920a01f0421c4323a

41 to_char(): have format 'OF' only show the leading negative sign · postgrespro/postgres@9b43d73 · GitHub
Skip to content

Commit 9b43d73

Browse files
committed
to_char(): have format 'OF' only show the leading negative sign
Previously both hours and minutes displayed as negative. Report by David Pozsar
1 parent 5086dfc commit 9b43d73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2507,7 +2507,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid col
25072507
s += strlen(s);
25082508
if (tm->tm_gmtoff % SECS_PER_HOUR != 0)
25092509
{
2510-
sprintf(s, ":%02ld", (tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
2510+
sprintf(s, ":%02ld", abs(tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
25112511
s += strlen(s);
25122512
}
25132513
break;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/9b43d73b3f9bef276a46660920a01f0421c4323a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy