X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id ECF22475843 for ; Wed, 26 Feb 2003 20:29:50 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 75505-07 for ; Wed, 26 Feb 2003 20:29:40 -0500 (EST) Received: from jester.inquent.com (CPE00508b028d7d-CM00803785c5e0.cpe.net.cable.rogers.com [24.103.51.175]) by postgresql.org (Postfix) with ESMTP id 25D2747580B for ; Wed, 26 Feb 2003 20:29:40 -0500 (EST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h1R1UJsM089014; Wed, 26 Feb 2003 20:30:22 -0500 (EST) (envelope-from rbt@rbt.ca) Subject: Re: timestamp output as seconds since epoch? From: Rod Taylor To: "A.M." Cc: pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-cPUlHgMvxc3VrxQ7xE96" Organization: Message-Id: <1046309418.88663.8.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 26 Feb 2003 20:30:19 -0500 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/593 X-Sequence-Number: 11991 --=-cPUlHgMvxc3VrxQ7xE96 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable select extract('epoch' from current_timestamp); On Wed, 2003-02-26 at 20:14, A.M. wrote: > I need to grab the pgsql timestamp as an integer (seconds since epoch)=20 > in order to compare the dates programmatically later on. What I'd like=20 > is: > SELECT CAST('12/12/2004 4:50:45.3' AS TIMESTAMP)::INT8; > The docs talk alot about date input but only discuss the 4 SET=20 > regionalized date output methods. Thanks! > ><><><><><><><><>< > AgentM > agentm@cmu.edu >=20 >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org --=20 Rod Taylor PGP Key: http://www.rbt.ca/rbtpub.asc --=-cPUlHgMvxc3VrxQ7xE96 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+XWoq6DETLow6vwwRAovYAJ9pt07ZsJ2uKGOwdT05BQ1yXnOhRQCffGmm UnesT5301KuqY1FASRBVaGk= =iIT0 -----END PGP SIGNATURE----- --=-cPUlHgMvxc3VrxQ7xE96--