timestamp conversion to unisgned long?
timestamp conversion to unisgned long?
От:
pierre@kahuna.versions.com
Дата:
All, Perhaps I'm not sing hte correct datatype, but I'd like to be able to convert a timestamp over to an unsigned long to be used within C code and compare to the output of time(). I can't seem to see any easy way of doing this using the built in stuff for postgresql. Ideas? Perhaps I'm using the wrong type? Pierre
Re: timestamp conversion to unisgned long?
От:
Alex Pilosov <alex@pilosoft.com>
Дата:
You probably want to use
select date_part('epoch', timeval);
On 22 Jun 2001 pierre@kahuna.versions.com wrote:
> All,
> Perhaps I'm not sing hte correct datatype, but I'd like to be able to convert
> a timestamp over to an unsigned long to be used within C code and compare
> to the output of time().
>
> I can't seem to see any easy way of doing this using the built in
> stuff for postgresql.
>
> Ideas?
>
> Perhaps I'm using the wrong type?
>
> Pierre
>
>
Re: timestamp conversion to unisgned long?
От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
pierre@kahuna.versions.com writes: > Perhaps I'm not sing hte correct datatype, but I'd like to be able to convert > a timestamp over to an unsigned long to be used within C code and compare > to the output of time(). extract(epoch from your_value_here) -- Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter