Обсуждение: How do I convert an interval into integer?

Поиск
Список
Период
Сортировка

How do I convert an interval into integer?

От
Wei Weng
Дата:
I want to convert an interval (from substraction between two timestamps) into 
a integer that represents how many seconds that interval has. How do I do 
that?

I am using postgresql 7.3.1

Thanks



Wei



Re: How do I convert an interval into integer?

От
Tomasz Myrta
Дата:
Dnia 2003-12-04 19:09, Użytkownik Wei Weng napisał:

> I want to convert an interval (from substraction between two timestamps) into 
> a integer that represents how many seconds that interval has. How do I do 
> that?

select extract(epoch from your_interval);

Regards,
Tomasz Myrta