Re: timestamp- milliseconds since epoch output - Mailing list pgsql-sql

From Tom Lane
Subject Re: timestamp- milliseconds since epoch output
Date
Msg-id 26381.981503837@sss.pgh.pa.us
Whole thread Raw
In response to timestamp- milliseconds since epoch output  (jkakar@expressus.com)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: Re: SQL Join - MySQL/PostgreSQL difference?
Next
From: Christopher Sawtell
Date:
Subject: Re: Postgres-HOWTO