Dates in postgres

Поиск
Список
Период
Сортировка
Искать

Dates in postgres

От:
Rob <rob@obsidian.co.za>
Дата:
Hi,

I can get today's date in postgres using the current_date function, but I
need to get the date one month ago from the current date.  Is there any
way to do this?

Thanks

Rob

-- 
He who dies with the most toys ...

					... still dies

Re: Dates in postgres

От:
"Josh Berkus" <josh@agliodbs.com>
Дата:
Rob,

> I can get today's date in postgres using the current_date function,
>  but I
> need to get the date one month ago from the current date.  Is there
>  any
> way to do this?

See:
http://techdocs.postgresql.org/techdocs/faqdatesintervals.php

-Josh

Re: Dates in postgres

От:
Anton de Wet <adw@obsidian.co.za>
Дата:
On Mon, 25 Feb 2002, Rob wrote:

> I can get today's date in postgres using the current_date function, but I
> need to get the date one month ago from the current date.  Is there any
> way to do this?

select now() - interval '1 month';


-- 

----------------------------------------------------------------------
"I really didn't foresee the Internet. But then, neither did the computer
industry. Not that that tells us very much of course - the computer industry
didn't even foresee that the century was going to end."
   - Douglas Adams 

FAQ