to_char(): Do not count negative sign as a digit for time values
Bruce Momjian <bruce@momjian.us>
to_char(): Do not count negative sign as a digit for time values
For time masks, like HH24, MI, SS, CC, MM, do not count the negative
sign as part of the zero-padding length specified by the mask, e.g. have
to_char('-4 years'::interval, 'YY') return '-04', not '-4'.
Report by Craig Ringer
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/formatting.c | modified | +18 −10 |
| src/test/regress/expected/timestamp.out | modified | +3 −3 |
| src/test/regress/expected/timestamptz.out | modified | +3 −3 |