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

From Andreas Karlsson
Subject Re: date_trunc() in a specific time zone
Date
Msg-id 1fae95e1-af93-d625-ee63-b08392454b11@proxel.se
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 10/29/2018 04:36 PM, 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 and mighty confusing.

Sloppy reading on my part, thanks for pointing it out.

Andreas


pgsql-hackers by date:

Previous
From: Andreas 'ads' Scherbaum
Date:
Subject: Installation instructions update (pg_ctl)
Next
From: Andrew Gierth
Date:
Subject: Re: date_trunc() in a specific time zone