Received: from rhea.arexim.ro (root@mail.arexim.ro [193.230.225.5]) by hub.org (8.9.1/8.9.1) with ESMTP id EAA09186 for ; Tue, 15 Dec 1998 04:16:57 -0500 (EST) (envelope-from george@flex.ro) Received: from arexim.arexim.ro (root@arexim.arexim.ro [193.230.225.2] (may be forged)) by rhea.arexim.ro (8.9.0/8.9.0) with ESMTP id MAA11720; Tue, 15 Dec 1998 12:14:35 +0200 Received: from flex.ro ([193.230.255.93]) by arexim.arexim.ro (8.7.5/8.7.3) with ESMTP id LAA27486; Tue, 15 Dec 1998 11:13:19 +0200 Sender: gestoc@arexim.ro Message-ID: <367627A3.32999BDB@flex.ro> Date: Tue, 15 Dec 1998 11:11:00 +0200 From: George Moga X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i586) MIME-Version: 1.0 To: Zsolt Varga , SQL PostgreSQL Subject: Re: [SQL] Unix dateformat ? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Zsolt Varga wrote: > hi! > > correct me, but is this possible postgresql doesn't contains any function > to convert date/datetime format to unix timestamp format? > > in mysql I can do it with: > > mysql> select unix_timestamp( now() ) as stamp; > +-----------+ > | stamp | > +-----------+ > | 913710262 | > +-----------+ > > before I make any function in 'c', please if you know some solution inform me, If I undestund what you want ... try this: SELECT date_part('epoch', 'now'::datetime) as seconds; This function returns: seconds --------- 913712585 (1 row) I use PostgreSQL 6.4 on Red Hat Linux 5.2 with 2.0.36 kernel version. -- Best, George Moga, george@flex.ro george@cicnet.ro Braila, ROMANIA.