mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
to_char(): have format 'OF' only show the leading negative sign
Previously both hours and minutes displayed as negative. Report by David Pozsar
This commit is contained in:
parent
5086dfceba
commit
9b43d73b3f
@ -2507,7 +2507,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid col
|
||||
s += strlen(s);
|
||||
if (tm->tm_gmtoff % SECS_PER_HOUR != 0)
|
||||
{
|
||||
sprintf(s, ":%02ld", (tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
|
||||
sprintf(s, ":%02ld", abs(tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
|
||||
s += strlen(s);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user