pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
epoch to show millseconds
3+ messages / 3 participants
[nested] [flat]

* epoch to show millseconds
@ 2001-07-12 00:39  Mars G Miro <mars@cannoncreek.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Mars G Miro @ 2001-07-12 00:39 UTC (permalink / raw)
  To: pgsql-sql; pgsql-general@postgresql.org

Hi All

	I've searched the archives, but it seems that there's no mention of this.
Basically, what I want to do is to show the milliseconds value.

	When I do a:
	sample=# select date_part('epoch', current_timestamp);
	 date_part
	-----------
	 994832815

	how do I make it accurate up to milliseconds value? the above is only up to
seconds.
	This is on Postgresql-7.0.3, btw.
	Thanks!



cheers
mars
PS. pls CC me as I'm not subscribed



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

* Re: [SQL] epoch to show millseconds
@ 2001-07-17 16:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mars G Miro <mars@cannoncreek.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2001-07-17 16:04 UTC (permalink / raw)
  To: mars@cannoncreek.com; +Cc: pgsql-sql; pgsql-general@postgresql.org

Mars G Miro <mars@cannoncreek.com> writes:
> 	how do I make it accurate up to milliseconds value?

You don't.  current_timestamp depends on the time() system call,
which only returns a number accurate to one second.

There is a higher-precision current time function in 7.1, but I
forget the details ... see the docs.  IIRC it existed but was
buggy in 7.0, so you'll need to update.

			regards, tom lane



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

* Re: [SQL] epoch to show millseconds
@ 2001-07-17 22:33  Grant <grant@conprojan.com.au>
  parent: Mars G Miro <mars@cannoncreek.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Grant @ 2001-07-17 22:33 UTC (permalink / raw)
  To: pgsql-sql; +Cc: pgsql-general@postgresql.org

> Hi All
> 
> 	I've searched the archives, but it seems that there's no mention of this.
> Basically, what I want to do is to show the milliseconds value.

FAQ: How can I select the time with milliseconds? 

binary_data=# select date_part('millisecond', timeofday()::timestamp); 
date_part 
------------------ 
534.253999999997 

A person asked this question a while back in #Postgresql on IRC EFNet.




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


end of thread, other threads:[~2001-07-17 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 00:39 epoch to show millseconds Mars G Miro <mars@cannoncreek.com>
2001-07-17 16:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-07-17 22:33 ` Grant <grant@conprojan.com.au>

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