Re: diference in dates in minutes

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: diference in dates in minutes
Дата
Msg-id 20050226180108.GB26473@wolff.to
обсуждение исходный текст
Ответ на diference in dates in minutes  ("Joel Fradkin" <jfradkin@wazagua.com>)
Ответы Re: diference in dates in minutes  ("Joel Fradkin" <jfradkin@wazagua.com>)
Список pgsql-sql
On Thu, Feb 24, 2005 at 17:34:08 -0500, Joel Fradkin <jfradkin@wazagua.com> wrote:
> Sorry for being redundant (I asked this a while back).
> I was looking for in days before and used date math
> Date1::date - date2::date returned the days which was fine for my original
> question.
> I did get a reply mentioning the age function and he mentioned I could get
> minutes etc.
> I looked up age in the docs and did not see it.
> Anyone have a example of using it to get the minutes between two date
> functions, or another method?

You probably want to convert the dates to timestamps, subtract them to
get an interval, extract the epoch to get timme in seconds and then divide
by 60 to get time in minutes.

The converting date to timestamp part isn't trivial. You need to decide
on what you mean when you do this. If you really have timestamps in the
first place, then you can skip the covernsion step.


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

Предыдущее
От: "ALÝ ÇELÝK"
Дата:
Сообщение: Re: triggers
Следующее
От: "Oisin Glynn"
Дата:
Сообщение: Reverse String in sql or pgplsql