Re: bigint and unix time

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: bigint and unix time
Дата
Msg-id 201108160643.54672.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на bigint and unix time  ("Janiv Ratson" <janivra@essence-grp.com>)
Список pgsql-sql
On Tuesday, August 16, 2011 2:12:52 am Janiv Ratson wrote:
> Hi Adrain and thank you,
> Trac 0.12 uses microseconds as time value.
> What do you suggest?

extract(epoch ..) returns seconds which you are trying to compare to 
microseconds. The solution would be to divide your 'time' values by 1,000,000 to 
make them seconds. Like:

SELECT ticket, "time"/1000000, author, field, oldvalue, newvalue FROM ticket_change where "time"/1000000  BETWEEN
extract(epoch from (date 'now' - integer '30')) AND       extract(epoch from (date 'now'));
 


> 
> Thanks,
> Janiv.
> 

-- 
Adrian Klaver
adrian.klaver@gmail.com


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

Предыдущее
От: Viktor Bojović
Дата:
Сообщение: Re: which is better: using OR clauses or UNION?
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: which is better: using OR clauses or UNION?