Re: Date calculation
От
Bruce Momjian
Тема
Re: Date calculation
Дата
Msg-id
20190131201514.GA3377@momjian.us
Ответ на
Date calculation (Ron)
Список
Дерево обсуждения
Date calculation Ron <ronljohnsonjr@gmail.com>
Re: Date calculation Bruce Momjian <bruce@momjian.us>
Re: Date calculation Ron <ronljohnsonjr@gmail.com>
Re: Date calculation Bruce Momjian <bruce@momjian.us>
Re: Date calculation Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Date calculation Andrew Gierth <andrew@tao11.riddles.org.uk>
On Thu, Jan 31, 2019 at 02:11:14PM -0600, Ron wrote:
> Hi,
>
> v9.6.6
>
> Is there a built in function to calculate, for example, next Sunday?
>
> For example,
>
> postgres=# select current_date, next_dow(current_date, 'Sunday');
> date | date
> ------------|------------
> 2019-01-31 | 2019-02-03
> (1 row)
Uh, this worked:
SELECT date_trunc('week', CURRENT_TIMESTAMP) + '6 days';
?column?
------------------------
2019-02-03 00:00:00-05
--
Bruce Momjian http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
В списке pgsql-general по дате отправления