Created
September 13, 2013 18:06
-
-
Save davetapley/6554061 to your computer and use it in GitHub Desktop.
Local time
This file contains hidden or 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
SELECT start_time, time_zone, start_time + (time_zone * INTERVAL '1 second') AS start_time_local FROM events LIMIT 1; | |
start_time | time_zone | start_time_local | |
-----------------------+-----------+----------------------- | |
2012-10-25 11:53:37.5 | -14400 | 2012-10-25 07:53:37.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gets very silly when we have multiple instances of
start_time + (time_zone * INTERVAL '1 second')
type expressions, usually wrapped with anEXTRACT
, all over the query.