Re: Per-query local timezone

From: Mark Morgan Lloyd <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk>
To: pgsql-general(at)PostgreSQL(dot)org
Subject: Re: Per-query local timezone
Date: 2011-06-14 12:13:12
Message-ID: it7j8p$jlt$1@pye-srv-01.telemetry.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Karsten Hilbert wrote:
> On Tue, Jun 14, 2011 at 09:40:20AM +0000, Mark Morgan Lloyd wrote:
>
>> Is it possible to incorporate SET TIMEZONE into a query, so that
>> to_char(...'TZ') etc. is appropriately localised?
>
> You seem to want "AT TIME ZONE".

Thanks for that. How can I do /this/

select to_char(now() at time zone 'GMT0BST', 'TZ');

It appears to return '', while if I used a separate SET TIMEZONE I'd
expect 'BST'.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2011-06-14 12:14:34 Re: PGP encrypt/decrypt - Prereqistes
Previous Message Hanno Schlichting 2011-06-14 11:48:28 Re: Tweaking bytea / large object block sizes?