Re: Timezone template for to_char(timestamp, '...')? - Mailing list pgsql-general

From Thomas Lockhart
Subject Re: Timezone template for to_char(timestamp, '...')?
Date
Msg-id 395CA2DA.5A19079A@alumni.caltech.edu
Whole thread Raw
In response to Re: Timezone template for to_char(timestamp, '...')?  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-general
> >       to_char(timestamp, 'Dy @MM:MIAM, Mon DD, YYYY')
> > to format a timestamp and its works fine except I'd like to add the
> > timezone (EDT etc) to the end.

Well, if you *really* need it:

  set datestyle = 'postgres';
  set time zone 'PST8PDT';
  select to_char(timestamp 'now' , 'Dy @MM:MIAM, Mon DD, YYYY')
   || ' '
   || substring(timestamp 'now' from char_length(timestamp 'now')-2);
--------------------------------
 Fri @06:35AM, Jun 30, 2000 PDT
(1 row)

                      - Thomas

pgsql-general by date:

Previous
From: Guillaume Perréal
Date:
Subject: Re: pg_dumpall and check constraints
Next
From: Philip Warner
Date:
Subject: Re: pg_dumpall and check constraints