Through various refactorings over time, the extract(timezone_minute
from time with time zone) and extract(timezone_minute from timestamp
with time zone) implementations ended up with two different but
equally nonsensical formulas by using SECS_PER_MINUTE and
MINS_PER_HOUR interchangeably. Since those two are of course both the
same number, the formulas do work, but for readability, fix them to be
semantically correct.
case DTK_TZ_MINUTE:
result = -tz;
result /= SECS_PER_MINUTE;
- FMODULO(result, dummy, (double) SECS_PER_MINUTE);
+ FMODULO(result, dummy, (double) MINS_PER_HOUR);
break;
case DTK_TZ_HOUR:
case DTK_TZ_MINUTE:
result = -tz;
- result /= MINS_PER_HOUR;
+ result /= SECS_PER_MINUTE;
FMODULO(result, dummy, (double) MINS_PER_HOUR);
break;