Re: Converting epoch to timestamp

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Converting epoch to timestamp
Дата
Msg-id 9F8155C6-D6E9-11D8-BD2A-000A95C88220@myrealbox.com
обсуждение исходный текст
Ответ на Re: Converting epoch to timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Jul 16, 2004, at 1:55 PM, Tom Lane wrote:
> This is in fact wrong, unless you live in the British Isles: the
> result will be off by your timezone displacement from UTC.  Correct
> is to use timestamptz not timestamp.

Thanks. Timestamps and time zones are a challenge for me.

> A cast from integer is probably a bad idea, seeing that it will break 
> in
> 2038.  You could make an argument for a cast from double though.  The
> issue to my mind is whether this might be too Unix-centric.

In my mind, epoch is pretty Unix-centric. In IRC we often see people 
who want to store timestamps in their db as strings or integers, which 
we are sure to point out isn't necessarily the best way to take 
advantage of PostgreSQL's strengths in handling timestamps.

Having these (corrected) functions available would be enough in my 
mind. The casting idea came about when I was thinking about where I'd 
put the functions in the documentation.

Michael Glaesemann
grzm myrealbox com



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Converting epoch to timestamp
Следующее
От: lists
Дата:
Сообщение: XLogWrite: write request 0/53A4000 is past end of log 0/53A4000