Michael Arnold <myk321@gmail.com> writes:
> Something like this:
> int32_t date_val = be32toh(*((uint32_t *) PQgetvalue(res, 0, 17)));
> Gives date_val=1,466,004,328 for 2022-10-25.
The origin is 2000-01-01 (I'm pretty sure that's documented somewhere),
so the correct integer value for that date is 8333 by my math.
Looking at the bit-pattern for 1,466,004,328: 0x57617368, it seems
totally unrelated, more like ASCII text ("Wash") than anything else.
You sure you're reading the right column of the result?
regards, tom lane