Received: from inje.iskon.hr (root@inje.iskon.hr [213.191.128.16]) by hub.org (8.10.1/8.10.1) with ESMTP id e89B8Df77054; Sat, 9 Sep 2000 07:08:13 -0400 (EDT) Received: from atlas.iskon.hr (atlas.iskon.hr [213.191.131.6]) by inje.iskon.hr (8.9.3/8.9.3/Debian 8.9.3-6) with ESMTP id NAA28102; Sat, 9 Sep 2000 13:08:11 +0200 Received: (from zcalusic@localhost) by atlas.iskon.hr (8.11.0/8.11.0/Debian 8.11.0-1) id e89B2dr00460; Sat, 9 Sep 2000 13:02:39 +0200 To: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Porting from mysql to psql (UNIX_TIMESTAMP()?) Reply-To: zlatko@iskon.hr X-Face: s71Vs\G4I3mB$X2=P4h[aszUL\%"`1!YRYl[JGlC57kU-`kxADX}T/Bq)Q9.$fGh7lFNb.s i&L3xVb:q_Pr}>Eo(@kU, c:3:64cR]m@27>1tGl1):#(bs*Ip0c}N{:JGcgOXd9H'Nwm:}jLr\FZtZ pri/C@\,4lW<|jrq^<):Nk%Hp@G&F"r+n1@BoH From: Zlatko Calusic Date: 09 Sep 2000 13:02:39 +0200 Message-ID: <874s3p3k1c.fsf@atlas.iskon.hr> Lines: 37 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.2 (Nike) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200009/216 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...