git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: d534b9e) | patch
I think I've finally identified the cause of the off-by-one-second
2004年5月31日 18:31:51 +0000 (18:31 +0000)
2004年5月31日 18:31:51 +0000 (18:31 +0000)
commit 87de80e95a7c5999dfaf4b769502c97cbe56248b
I think I've finally identified the cause of the off-by-one-second
issue in timestamp conversion that we hacked around for so long by
ignoring the seconds field from localtime(). It's simple: you have
to watch out for platform-specific roundoff error when reducing a
possibly-fractional timestamp to integral time_t form. In particular
we should subtract off the already-determined fractional fsec field.
This should be enough to get an exact answer with int64 timestamps;
with float timestamps, throw in a rint() call just to be sure.
src/backend/utils/adt/timestamp.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /