Re: date_trunc() in a specific time zone - Mailing list pgsql-hackers

From David Fetter
Subject Re: date_trunc() in a specific time zone
Date
Msg-id 20181104203521.GA2527@fetter.org
Whole thread Raw
In response to date_trunc() in a specific time zone  (Vik Fearing <vik.fearing@2ndquadrant.com>)
List pgsql-hackers
On Mon, Oct 29, 2018 at 04:18:23PM +0100, 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.
> 
> Attached is a patch to create a function for it, based off 5953c99697.

+1

In a slightly related matter, at some point, we also need to come up
with a timestamptz2 or some such which preserves the input time zone.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"
Next
From: David Rowley
Date:
Subject: Re: Ordered Partitioned Table Scans