birthday calculation

Поиск
Список
Период
Сортировка
От Ben
Тема birthday calculation
Дата
Msg-id 1058943234.1468.1324.camel@purple
обсуждение исходный текст
Ответы Re: birthday calculation  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Re: birthday calculation  (nolan@celery.tssi.com)
Re: birthday calculation  (Network Administrator <netadmin@vcsn.com>)
Re: birthday calculation  (greg@turnstep.com)
Список pgsql-general
It must be late, because I cannot seem to figure this out. I've got a
field which has a user's birthday - I want to figure out how old they
are in terms of years.

If I just do something like:

select current_date - user.bday;

I get their age in days, which doesn't let me take leap years into
account. Is there a simple magic date_diff function that I'm missing? Or
lacking that some other way to get postgres to do the date calculations?


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

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: 0/1 vs true/false
Следующее
От: Chris Travers
Дата:
Сообщение: Re: 0/1 vs true/false