pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
timestamp conversion to unisgned long?
3+ messages / 3 participants
[nested] [flat]

* timestamp conversion to unisgned long?
@ 2001-06-22 18:08 pierre@kahuna.versions.com
  2001-06-22 18:46 ` Re: timestamp conversion to unisgned long? Alex Pilosov <alex@pilosoft.com>
  2001-06-22 19:19 ` Re: timestamp conversion to unisgned long? Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 3+ messages in thread

From: pierre@kahuna.versions.com @ 2001-06-22 18:08 UTC (permalink / raw)
  To: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: timestamp conversion to unisgned long?
  2001-06-22 18:08 timestamp conversion to unisgned long? pierre@kahuna.versions.com
@ 2001-06-22 18:46 ` Alex Pilosov <alex@pilosoft.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Alex Pilosov @ 2001-06-22 18:46 UTC (permalink / raw)
  To: pierre@kahuna.versions.com; +Cc: pgsql-sql

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
> 
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: timestamp conversion to unisgned long?
  2001-06-22 18:08 timestamp conversion to unisgned long? pierre@kahuna.versions.com
@ 2001-06-22 19:19 ` Peter Eisentraut <peter_e@gmx.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2001-06-22 19:19 UTC (permalink / raw)
  To: pierre@kahuna.versions.com; +Cc: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-06-22 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-22 18:08 timestamp conversion to unisgned long? pierre@kahuna.versions.com
2001-06-22 18:46 ` Alex Pilosov <alex@pilosoft.com>
2001-06-22 19:19 ` Peter Eisentraut <peter_e@gmx.net>

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