Re: timestamp check

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: timestamp check
Date: 2015-07-13 14:09:32
Message-ID: 55A3C69C.7010104@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/07/2015 17:11, Ramesh T wrote:
> okay,i'm executing a query from pgadmin3.
>
> i want display time with timezone.But above query displaying date and
> time not timezone...
>
> On Sat, Jul 11, 2015 at 9:34 PM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com <mailto:david(dot)g(dot)johnston(at)gmail(dot)com>> wrote:
>
> On Fri, Jul 10, 2015 at 8:54 AM, Ramesh T
> <rameshparnanditech(at)gmail(dot)com
> <mailto:rameshparnanditech(at)gmail(dot)com>>wrote:
>
>
> select
> current_timestamp-to_timestamp(to_char(current_date,'YYYY-MM-DD
> HH24'||':'||'MI'||':'||'SS')||' '||(SELECT utc_offset FROM
> pg_catalog.pg_timezone_names
> WHERE name='US/Eastern'),'YYYY-MM-DD
> HH24'||':'||'MI'||':'||'SS')::timestamptz;
>
> it's not displaying timezone..any help..?

Hi there,

This question was answered a few days ago, but perhaps you didn't see
it. The reason you don't get timezone information is that subtracting
two timestamps results in an interval value. See table 9-27 on this page:

http://www.postgresql.org/docs/9.4/static/functions-datetime.html

Also, please don't top-post; the convention on this list is to
bottom-post. Thanks! :-)

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2015-07-13 14:15:40 Obtaining advisory lock using ORDER BY
Previous Message Adrian Klaver 2015-07-13 14:05:48 Re: timestamp check