| От | Bruno Wolff III |
|---|---|
| Тема | Re: Another date / time question |
| Дата | |
| Msg-id | 20040326204212.GD20194@wolff.to обсуждение исходный текст |
| Ответ на | Re: Another date / time question (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
On Fri, Mar 26, 2004 at 12:21:59 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote: > "Vanole, Mike" <mike.vanole@attws.com> writes: > > I'm trying to query two timestamp(0) columns to determine elapsed time. I u= > > se the age() function which works fine, but I want to return the informatio= > > n in MINUTES.=20 > > Just subtract (giving an interval), use extract(epoch) to get the > interval in seconds, then divide by 60 and round (or truncate if you > prefer). To expand on this, while age returns an interval, it will include a months part in the interval (if the timestamps are over of month apart) and this will mess up your calculation. When you just subtract, you will get an absolute time difference that you can reliably convert to minutes.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера