Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))

Поиск
Список
Период
Сортировка
От Robert Burgholzer
Тема Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))
Дата
Msg-id CACT-NGKK1vQxb+UDwj_Ji6co+COf-6P6nm7YAME+e4L4xvbJuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))  (Scott Ribe <scott_ribe@elevated-dev.com>)
Ответы Re: Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))  (Scott Ribe <scott_ribe@elevated-dev.com>)
Re: Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-admin
Ok, thanks a ton - I get it! (i think) let me try this out (maybe you said this all along:

- an epoch is by definition in GMT - it can't be otherwise
- an epoch is translated from its source TZ if TZ is specified, otherwise it's assumed GMT
- to_timestamp translates into the local TZ Always.
- therefore, the only time TStamp->Epoch->Tstamp results in identity is when the TZ of the original Tstamp is in the TZ specified in postgresql.conf?

The "always" part of to_timestamp seems a tad limiting, but I dig, "+ interval" is my friend.

Thanks!

On Tuesday, May 12, 2015, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
On May 12, 2015, at 12:07 PM, Robert Burgholzer <rburghol@vt.edu> wrote:
>
> But if nothing else, it still seems to me that "to_timestamp" and "extract(epoch)" are making different assumptions when TZ is not known.

Not really, it’s just that by default the result of to_timestamp is *displayed* in your local zone.

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice







--
--
Robert W. Burgholzer
 'Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that's creativity.'  - Charles Mingus

В списке pgsql-admin по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Timestamp Shifts when calling to_timestamp(extract (epoch from timestamp))