Received: from servsbs.deltson.com ([212.234.85.57]) by hub.org (8.10.1/8.10.1) with ESMTP id e739x3G57523 for ; Thu, 3 Aug 2000 05:59:03 -0400 (EDT) Received: from ange.alpinfo.fr (ANGE [192.0.1.82]) by servsbs.deltson.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id PT8AVJS7; Thu, 3 Aug 2000 11:51:56 +0200 From: Ange Michel POZZO Reply-To: poange@technologist.com Organization: Alpinfo To: Karel Zak Subject: Re: a question about dates and timestamp Date: Thu, 3 Aug 2000 11:30:31 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: In-Reply-To: Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Message-Id: <00080311565801.00710@ange.alpinfo.fr> Content-Transfer-Encoding: 8bit X-Archive-Number: 200008/19 Le jeu, 03 aoû 2000, Karel Zak a écrit : > > my question is how can i convert the numeric or the int4 value to > > a date value? > > > test=# select abstime(965293003); > abstime > ------------------------ > 2000-08-03 10:56:43+02 > (1 row) > > Karel this is the result of the query for me : test=> select abstime(965293003); ?column? --------- 965293003 (1 row) i must do : select datetime(abstime( value )); if value is a int4 work ok but for a numeric, it don't work i have tried to convert a numeric to int4 with floor, int4, numeric_int4 nothing work ! select datetime(abstime( floor (value) )); select datetime(abstime( int4 (value) )); select datetime(abstime( numeric_int4 (value) )); in all case : ERROR: pg_atoi: error in "952969611.000000": can't parse ".000000" what is the way to convert numeric to int4 ? i know this is'nt a good choise to store timestamp in a int4 or numeric value, but i found the database like this and know i can't change this :( thanks POZZO ange