Re: How do I get the current time in seconds in the unix epoch?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill Studenmund <wrstuden(at)netbsd(dot)org>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How do I get the current time in seconds in the unix epoch?
Date: 2001-10-13 04:12:38
Message-ID: 8289.1002946358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bill Studenmund <wrstuden(at)netbsd(dot)org> writes:
> In 7.1 I was able to get this (I thought) with
> date_part(''epoch'', timestamp ''now'') . That doesn't seem to work for me
> in last week's -current.

Indeed: in 7.1 I can do

test71=# select date_part('epoch', timestamp 'now');
date_part
------------
1002946239
(1 row)

but current sources give

regression=# select date_part('epoch', timestamp 'now');
ERROR: Timestamp with time zone units 'epoch' not recognized

Thomas, I think you broke something.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-10-13 04:13:32 Re: TOAST and TEXT
Previous Message Bruce Momjian 2001-10-13 03:56:18 Re: row value constructor bug?