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

From Vik Fearing
Subject Re: date_trunc() in a specific time zone
Date
Msg-id 21dec999-c2b7-db9e-7f68-899436a5f2a3@2ndquadrant.com
Whole thread Raw
In response to Re: date_trunc() in a specific time zone  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 29/10/2018 16:36, Tom Lane wrote:
> Andreas Karlsson <andreas@proxel.se> writes:
>> 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')
> 
> The latter would give you timestamp without time zone, whereas I think
> what Vik wants is timestamp with time zone.  Yeah, you could then convert
> it back with a second application of AT TIME ZONE 'Australia/Sydney',
> but that's both inefficient

Hmm, converting it back is exactly what my function does...

> and mighty confusing.

This is my justification for needing the patch.
-- 
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: date_trunc() in a specific time zone
Next
From: Vik Fearing
Date:
Subject: Re: date_trunc() in a specific time zone