Re: Timezone template for to_char(timestamp, '...')?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
Cc: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, pgsql-general(at)postgresql(dot)org
Subject: Re: Timezone template for to_char(timestamp, '...')?
Date: 2000-06-30 13:38:34
Message-ID: 395CA2DA.5A19079A@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Philip Warner 2000-06-30 13:47:42 Re: pg_dumpall and check constraints
Previous Message Guillaume Perréal 2000-06-30 13:35:06 Re: pg_dumpall and check constraints