Last active
August 29, 2015 14:01
-
-
Save gurjeet/088a91d6f45cfe1e842d to your computer and use it in GitHub Desktop.
Why timestamp(0) rounding is horrible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edb=# select now() as "time", now()::timestamptz(0) as "time_round", date_trunc('seconds', now()) as "time_trunc"; | |
time | time_round | time_trunc | |
----------------------------------+---------------------------+--------------------------- | |
21-MAY-14 14:19:04.549852 -04:00 | 21-MAY-14 14:19:05 -04:00 | 21-MAY-14 14:19:04 -04:00 | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment