pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rob stone <floriparob@gmail.com>
To: Bharanee Rathna <deepfryed@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: ISO8601 vs POSIX offset clarification
Date: Mon, 04 Dec 2017 23:07:02 +1100
Message-ID: <1512389222.5095.4.camel@gmail.com> (raw)
In-Reply-To: <CAOX4-H5tV6YQr-hGarsjcJ5pBwXY=usN-0nFo50oNzPiKaOOfw@mail.gmail.com>
References: <CAOX4-H7gnUNV50d7N9E0V6q=LVuu4ewiuzmnBXmggkBs8DgeSA@mail.gmail.com>
	<21940.1512356153@sss.pgh.pa.us>
	<CAOX4-H7xoBvAgXbj=bnwGT6QF407fNKsnmr7fWs8KnLqv7=NtA@mail.gmail.com>
	<CAOX4-H5tV6YQr-hGarsjcJ5pBwXY=usN-0nFo50oNzPiKaOOfw@mail.gmail.com>



On Mon, 2017-12-04 at 14:03 +1100, Bharanee Rathna wrote:
> To be more specific, I expected the output of both these queries to
> be the same.
> 
> # select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at
> time zone '+11:00';
>       timezone       
> ---------------------
>  2017-11-30 13:00:00
> 
> # select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at
> time zone 'Australia/Melbourne';
>       timezone       
> ---------------------
>  2017-12-01 11:00:00
> 
> Cheers
> 


select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at time
zone INTERVAL '+11:00';

Result:-

2017-12-01 11:00:00.0


You need the INTERVAL keyword when using a numeric value instead of a
time zone name. It's in the doco.

The parser ought to throw an error, but it doesn't.
 






view thread (6+ messages)  latest in thread

Message-ID: <1512389222.5095.4.camel@gmail.com>
Permalink:  ../1512389222.5095.4.camel@gmail.com/
Also on:    postgresql.org/message-id/1512389222.5095.4.camel@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: floriparob@gmail.com, deepfryed@gmail.com
  Subject: Re: ISO8601 vs POSIX offset clarification
  In-Reply-To: <1512389222.5095.4.camel@gmail.com>
  References: <CAOX4-H7gnUNV50d7N9E0V6q=LVuu4ewiuzmnBXmggkBs8DgeSA@mail.gmail.com> <21940.1512356153@sss.pgh.pa.us> <CAOX4-H7xoBvAgXbj=bnwGT6QF407fNKsnmr7fWs8KnLqv7=NtA@mail.gmail.com> <CAOX4-H5tV6YQr-hGarsjcJ5pBwXY=usN-0nFo50oNzPiKaOOfw@mail.gmail.com> <1512389222.5095.4.camel@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox