Re: date_trunc() in a specific time zone
От
Andreas Karlsson
Тема
Re: date_trunc() in a specific time zone
Дата
Msg-id
7f0712c3-dad7-5aef-428e-db05a0a310df@proxel.se
Ответ на
date_trunc() in a specific time zone (Vik Fearing)
Список
Дерево обсуждения
date_trunc() in a specific time zone Vik Fearing <vik.fearing@2ndquadrant.com>
Re: date_trunc() in a specific time zone David Fetter <david@fetter.org>
Re: date_trunc() in a specific time zone Andreas Karlsson <andreas@proxel.se>
Re: date_trunc() in a specific time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: date_trunc() in a specific time zone Andreas Karlsson <andreas@proxel.se>
Re: date_trunc() in a specific time zone Vik Fearing <vik.fearing@2ndquadrant.com>
Re: date_trunc() in a specific time zone Vik Fearing <vik.fearing@2ndquadrant.com>
Re: date_trunc() in a specific time zone Corey Huinker <corey.huinker@gmail.com>
Re: date_trunc() in a specific time zone Steve Crawford <scrawford@pinpointresearch.com>
Re: date_trunc() in a specific time zone Vik Fearing <vik.fearing@2ndquadrant.com>
Re: date_trunc() in a specific time zone Paul A Jungwirth <pj@illuminatedcomputing.com>
Re: date_trunc() in a specific time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: date_trunc() in a specific time zone Paul A Jungwirth <pj@illuminatedcomputing.com>
Re: date_trunc() in a specific time zone Paul A Jungwirth <pj@illuminatedcomputing.com>
Re: date_trunc() in a specific time zone Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: date_trunc() in a specific time zone Paul A Jungwirth <pj@illuminatedcomputing.com>
Re: date_trunc() in a specific time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: date_trunc() in a specific time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: date_trunc() in a specific time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: date_trunc() in a specific time zone Vik Fearing <vik.fearing@2ndquadrant.com>
On 10/29/2018 04:18 PM, Vik Fearing wrote:
> A use case that I see quite a lot of is needing to do reports and other
> calculations on data per day/hour/etc but in the user's time zone. The
> way to do that is fairly trivial, but it's not obvious what it does so
> reading queries becomes just a little bit more difficult.
Hm, I am not sure if I see any major win from writing
date_trunc('day', timestamptz '2001-02-16 20:38:40+00', 'Australia/Sydney')
instead of
date_trunc('day', timestamptz '2001-02-16 20:38:40+00' AT TIME ZONE
'Australia/Sydney')
. Especially since you still will have to do the second for other time
related functions like date(). Maybe a slight win in that new users who
read the manual will be reminded that they need to care about time
zones, but I also see a value in teaching users about how to use "AT
TIME ZONE".
Andreas
В списке pgsql-hackers по дате отправления