Received: from tolikus.hq.aaanet.ru (tolikus.hq.aaanet.ru [195.151.212.227]) by hub.org (8.9.2/8.9.1) with ESMTP id FAA48702; Sun, 7 Mar 1999 05:02:59 -0500 (EST) (envelope-from tolik@tolikus.hq.aaanet.ru) Received: (from tolik@localhost) by tolikus.hq.aaanet.ru (8.9.1/8.9.1) id MAA11456; Sun, 7 Mar 1999 12:56:14 +0300 (MSK) (envelope-from tolik) To: hoelc@pd.jaring.my Cc: pgsql-admin@hub.org, pgsql-admin@postgreSQL.org, pgsql-general@hub.org Subject: Re: [ADMIN] date & time References: <36E163D7.CD95C55A@pd.jaring.my> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII From: tolik@icomm.ru (Anatoly K. Lasareff) Date: 07 Mar 1999 12:56:05 +0300 In-Reply-To: hoelc's message of "Sun, 07 Mar 1999 01:20:23 +0800" Message-ID: <87emn1fwsq.fsf@tolikus.hq.aaanet.ru> Lines: 35 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" >>>>> "h" == hoelc writes: h> Hello, h> Can some one please tell me how to set the date&time in the PostgreSQL h> system? h> I try to use date('now') and time('now') to keep tract of the data and h> time when the data is inserted or updated. When I use sql " insert into h> table (data1, date_chg, time_chg) values ('abc',date('now'),time('now')) h> " to insert the date and time data, the data successfully inserted but h> when I retrive the data, it shows that the date and time is always " h> 01-01-2000 " and " 08:00:00 " , now is of couse not year 2000 and the h> time is also not 8 o'clock. Why? How should I correct this? h> I am using PostgreSQL in Linux system, and the date & time for Linux h> system are correct. Yes, here is the problem: tolik=> select date('now'), time('now'); date|time ----------+-------- 01-01-2000|03:00:00 (1 row) Here is the solution: tolik=> select date('now'::datetime), time('now'::datetime); date|time ----------+-------- 03-07-1999|13:00:55 (1 row) -- Anatoly K. Lasareff Email: tolik@icomm.ru Senior programmer