pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Larry Rosenman <ler@lerctr.org>
To: mohan@physics.gmu.edu
To: pgsql-sql@postgresql.org
Subject: Re: date function problem
Date: Tue, 03 Feb 2004 10:01:22 -0600
Message-ID: <105750000.1075824082@lerlaptop-red.iadfw.net> (raw)
In-Reply-To: <61599.138.88.163.115.1075823505.squirrel@physics.gmu.edu>
References: <61599.138.88.163.115.1075823505.squirrel@physics.gmu.edu>



--On Tuesday, February 03, 2004 10:51:45 -0500 mohan@physics.gmu.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@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

view thread (3+ messages)  latest in thread

Message-ID: <105750000.1075824082@lerlaptop-red.iadfw.net>
Permalink:  ../105750000.1075824082@lerlaptop-red.iadfw.net/
Also on:    postgresql.org/message-id/105750000.1075824082@lerlaptop-red.iadfw.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ler@lerctr.org, mohan@physics.gmu.edu
  Subject: Re: date function problem
  In-Reply-To: <105750000.1075824082@lerlaptop-red.iadfw.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox