Search Postgresql Archives

Re: ISO8601 vs POSIX offset clarification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.
 






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux