Thread: timestamp
Hi, How do insert a timestamp in a timestamp field. insert into table (tt) values (now()+100) doesn't seem to work
Marc Cuypers writes: > How do insert a timestamp in a timestamp field. > insert into table (tt) values (now()+100) > doesn't seem to work What is now()+100 supposed to mean? Maybe you mean now() + interval '100 seconds' or some other unit. -- Peter Eisentraut peter_e@gmx.net
On Wed, Jun 04, 2003 at 14:43:31 +0200, Marc Cuypers <mail@mgvd.be> wrote: > Hi, > > How do insert a timestamp in a timestamp field. > > insert into table (tt) values (now()+100) > > doesn't seem to work You probably want something like now() + '100 seconds' .
Try INSERT INTO tt VALUES (now()+100); Vincent Hikida, Member of Technical Staff - Urbana Software, Inc. "A Personalized Learning Experience" www.UrbanaSoft.com ----- Original Message ----- From: "Marc Cuypers" <mail@mgvd.be> To: <pgsql-general@postgresql.org> Sent: Wednesday, June 04, 2003 5:43 AM Subject: [GENERAL] timestamp > Hi, > > How do insert a timestamp in a timestamp field. > > insert into table (tt) values (now()+100) > > doesn't seem to work > > > ---------------------------(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 >
On Wed, 4 Jun 2003, Marc Cuypers wrote: > Hi, > > How do insert a timestamp in a timestamp field. > > insert into table (tt) values (now()+100) > > doesn't seem to work Here's a page that might help: http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=functions-datetime.html A quick hint, select now() + interval '1 hour'; select now() + interval '45 seconds';