Re: int4 -> unix timestamp -> sql timestamp; abstime?
От | Tom Lane |
---|---|
Тема | Re: int4 -> unix timestamp -> sql timestamp; abstime? |
Дата | |
Msg-id | 5195.1105486518@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | int4 -> unix timestamp -> sql timestamp; abstime? (Roman Neuhauser <neuhauser@chello.cz>) |
Ответы |
Re: int4 -> unix timestamp -> sql timestamp; abstime?
Re: int4 -> unix timestamp -> sql timestamp; abstime? Re: int4 -> unix timestamp -> sql timestamp; abstime? |
Список | pgsql-general |
Roman Neuhauser <neuhauser@chello.cz> writes: > what is the opposite of cast(extract('epoch' from now()) as int)? > The only thing I found that works is > cast(cast(... as abstime) as timestamp) > and the documentation says abstime shouldn't be used, and may > disappear. What should I use instead? The recommended locution is SELECT TIMESTAMP WITH TIME ZONE 'epoch' + <x> * INTERVAL '1 second'; Of course you can wrap this up in a function if you prefer (not sure why we haven't done so already). regards, tom lane
В списке pgsql-general по дате отправления: