Ruslan <ruslan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes: > I wrote parser for COPY binary encoding. Everything is great but one thing > worries me. It seems like the time offset field has reversed digit sign. > I'm referring to this function > https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/utils/adt/date.c#L2150-L2159 Reversed compared to what? The code you quote is clearly sending the internal representation as-is. There's a lot of confusion in the world about whether positive timezone offsets correspond to being east or west of Greenwich (not helped any by the fact that there are relevant standards using both interpretations). I think that our internal form uses positive-is-west, a/k/a POSIX rules, but I'm too lazy to go check right now. regards, tom lane