Received: from mail.ramcargroup.com (mail.ramcargroup.com [202.58.114.60]) by hub.org (8.10.1/8.10.1) with ESMTP id e89BKCf81441; Sat, 9 Sep 2000 07:20:12 -0400 (EDT) Received: from mmj.ramcargroup.com (ip-10.16.16.16.ramcargroup.com [10.16.16.16]) by mail.ramcargroup.com (Postfix) with ESMTP id D41CDF2F3E; Sat, 9 Sep 2000 19:20:09 +0800 (PHT) Received: from ramcargroup.com (unknown [133.88.30.131]) by mmj.ramcargroup.com (Postfix) with ESMTP id ACDA7F2042; Sat, 9 Sep 2000 19:53:50 +0800 (PHT) Message-ID: <39BA1E47.94398377@ramcargroup.com> Date: Sat, 09 Sep 2000 19:25:59 +0800 From: "Rommel B. Abaya" X-Mailer: Mozilla 4.72 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: zlatko@iskon.hr Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: Porting from mysql to psql (UNIX_TIMESTAMP()?) References: <874s3p3k1c.fsf@atlas.iskon.hr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200009/217 i thick it's epoch() in PostgreSQL....check your documentation. Zlatko Calusic wrote: > Hi! > > As subject says, we are currently porting all of our data, programs > and logic from mysql to postgresql. One of the things we have yet to > resolve is how to replace mysql's UNIX_TIMESTAMP() function we used > extensively in PosgreSQL? > > Function works like this in mysql: > > mysql> select start from connection limit 1; > +---------------------+ > | start | > +---------------------+ > | 2000-07-03 20:12:37 | > +---------------------+ > 1 row in set (0.01 sec) > > mysql> select UNIX_TIMESTAMP(start) from connection limit 1; > +-----------------------+ > | UNIX_TIMESTAMP(start) | > +-----------------------+ > | 962647957 | > +-----------------------+ > 1 row in set (0.00 sec) > > Is there any similar functionality (returning unixish number of > seconds since 1970 from the timestamp field) in PostgreSQL? > > I tried all of the available date/time functions, type casting but all > to no avail. > > TIA, > -- > Zlatko > > P.S Is it bad manners crossposting to two pgsql mailing list? Still > new to PostgreSQL, still learning...