Re: Date addition/subtraction

Поиск
Список
Период
Сортировка
От Franco Bruno Borghesi
Тема Re: Date addition/subtraction
Дата
Msg-id e13c14ec05050310396f9ad4b4@mail.gmail.com
обсуждение исходный текст
Ответ на Date addition/subtraction  ("Craig Bryden" <postgresql@bryden.co.za>)
Список pgsql-general
It's easy. You have to know that INTERVAL data type exist, so:

SELECT current_date - '30 days'::interval
SELECT current_timestamp - '1 hour'::interval


2005/5/3, Craig Bryden <postgresql@bryden.co.za>:
Hi

How in postgres can I do date/time subtraction or addition.
e.g. If I want to get today's date - 30 days? or current_timestamp - 1 hour?

Thanks
Craig

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly

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

Предыдущее
От: "Craig Bryden"
Дата:
Сообщение: Date addition/subtraction
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: postgresql 8 abort with signal 10