Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9C6659F926D for ; Wed, 7 Nov 2007 06:37:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 13463-01 for ; Wed, 7 Nov 2007 06:37:08 -0400 (AST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id 3BF9C9F924B for ; Wed, 7 Nov 2007 06:37:08 -0400 (AST) Received: by py-out-1112.google.com with SMTP id u77so4782980pyb for ; Wed, 07 Nov 2007 02:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=hvXL8c9vzcYJC9CfEHLvpXKmqhlAuVD/wy3rWNiOZj4=; b=NQew4q8vU1rbJWidBCYaaNGIGCjfJXIc0b2gNoCCmM81huheXqJfecBcV5MPeIbuiH4IKH5dasOW29NxkxcMZauMAK0V5w29o1JC27SJgD8i2OpBOqOlcKprW3I53UEJmb5cBzevK2lVUvUj8+hwOYqtq6QsgL4IFlnZfANu7KQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NgJRQrDp92B3Ckg0Rzpwbbz7MOvapIcvcMttLxrcXpnBxWlox3UcR6v6S3kGFxPyZCAGmPdEfkE+d8zlmoa9atdIpwJsJdc/XejBTRw0URYwLL6AYcs6GniFi7zehCkw7X4jZ35UXHeJOA9bdhy3kcsAyE+kBfR4LnFaRJ1JTFo= Received: by 10.35.75.15 with SMTP id c15mr8711819pyl.1194431825956; Wed, 07 Nov 2007 02:37:05 -0800 (PST) Received: by 10.35.18.7 with HTTP; Wed, 7 Nov 2007 02:37:05 -0800 (PST) Message-ID: <7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com> Date: Wed, 7 Nov 2007 16:07:05 +0530 From: "Amitanand Chikorde" To: pgsql-sql@postgresql.org Subject: EPOCH TIMESTAMP Conversion Problem MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/23 X-Sequence-Number: 29551 hi all, I have a table 'myTable'. There is an attribute in the table as, Column | Type | Modifiers -----------------+-----------------------------+----------- mydate | timestamp without time zone | not null I want to convert MAX(mydate) from myTable to Epoch. SELECT EXTRACT(EPOCH FROM TIMESTAMP WITHOUT TIME ZONE '2007-11-01 17:42:01.81693') ::int4; How the above query can be used to convert MAX(mydate) to EPoch value? Is there any other query that I can use? I think it is not worth to write a function/procedure to just replace the value in a query? Please HELP................... Thanks in advance -- Amitanand N. Chikorde. Software Engineer ================================== cat /dev/zero >/dev/null ==================================