From: Tom Lane <tgl@sss.pgh.pa.us>
To: jkakar@expressus.com
Cc: pgsql-sql@postgresql.org
Subject: Re: timestamp- milliseconds since epoch output
Date: Tue, 06 Feb 2001 18:57:17 -0500
Message-ID: <26381.981503837@sss.pgh.pa.us> (raw)
In-Reply-To: <20010206103939.A13042@expressus.com>
References: <20010206103939.A13042@expressus.com>
jkakar@expressus.com writes:
> I've tried using variations of to_char and to_timestamp but can't seem
> to get the timestamp as a value of milliseconds since the Epoch (Jan
> 1, 1970).
regression=# select date_part('epoch','2001-02-05 17:23:26.123456-08'::timestamp);
date_part
------------------
981422606.123456
(1 row)
Multiply by 1000 if you feel a strong urge to have it in milliseconds...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, jkakar@expressus.com
Subject: Re: timestamp- milliseconds since epoch output
In-Reply-To: <26381.981503837@sss.pgh.pa.us>
References: <20010206103939.A13042@expressus.com> <26381.981503837@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox