Re: date function problem

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: mohan(at)physics(dot)gmu(dot)edu, pgsql-sql(at)postgresql(dot)org
Subject: Re: date function problem
Date: 2004-02-03 16:01:22
Message-ID: 105750000.1075824082@lerlaptop-red.iadfw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--On Tuesday, February 03, 2004 10:51:45 -0500 mohan(at)physics(dot)gmu(dot)edu wrote:

> Hi All
> I have an expiration_date column in my table with data type as timestamp.
> I need to set that as one year after the current time. how do i do that. I
> am getting a casting problem whenever i try something.
>
> something like now()+ 1 year. Please let me know

ler=# select now()+'1 year';
?column?
-------------------------------
2005-02-03 10:00:40.913383-06
(1 row)

ler=#

ler=# select version();
version
---------------------------------------------------------------------------
---------------------
PostgreSQL 7.4.1 on i386-portbld-freebsd5.2, compiled by GCC cc (GCC)
3.3.3 [FreeBSD] 20031106
(1 row)

ler=#

> --mohan
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2004-02-03 16:03:19 Re: date function problem
Previous Message mohan 2004-02-03 15:51:45 date function problem