pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Unix dateformat ?
2+ messages / 2 participants
[nested] [flat]

* Unix dateformat ?
@ 1998-12-15 08:23 Zsolt Varga <redax@agria.hu>
  1998-12-15 09:11 ` Re: [SQL] Unix dateformat ? George Moga <george@flex.ro>
  0 siblings, 1 reply; 2+ messages in thread

From: Zsolt Varga @ 1998-12-15 08:23 UTC (permalink / raw)
  To: pgsql-sql


hi!

correct me, but is this possible postgresql doesn't contains any function 
to convert date/datetime format to unix timestamp format?

in mysql I can do it with:

mysql> select unix_timestamp( now() ) as stamp;
+-----------+
| stamp     |
+-----------+
| 913710262 |
+-----------+

before I make any function in 'c', please if you know some solution inform
me,

	thanks,
	regards	
		Redax

.----------------------------------------------------------.
|Zsolt Varga            | tel/fax:   +36 36 422811         |
| AgriaComputer LTD     | email:     redax@agria.hu        |
| System Administrator  | URL:       http://www.agria.hu/  |
`----------------------------------------------------------'




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

* Re: [SQL] Unix dateformat ?
  1998-12-15 08:23 Unix dateformat ? Zsolt Varga <redax@agria.hu>
@ 1998-12-15 09:11 ` George Moga <george@flex.ro>
  0 siblings, 0 replies; 2+ messages in thread

From: George Moga @ 1998-12-15 09:11 UTC (permalink / raw)
  To: Zsolt Varga <redax@agria.hu>; pgsql-sql

Zsolt Varga wrote:

> hi!
>
> correct me, but is this possible postgresql doesn't contains any function
> to convert date/datetime format to unix timestamp format?
>
> in mysql I can do it with:
>
> mysql> select unix_timestamp( now() ) as stamp;
> +-----------+
> | stamp     |
> +-----------+
> | 913710262 |
> +-----------+
>
> before I make any function in 'c', please if you know some solution inform me,

If I undestund what you want ... try this:

SELECT date_part('epoch', 'now'::datetime) as seconds;

This function returns:

  seconds
---------
913712585
(1 row)

I use PostgreSQL 6.4 on Red Hat Linux 5.2 with 2.0.36 kernel version.

--
Best,
        George Moga,
        george@flex.ro
        george@cicnet.ro
        Braila, ROMANIA.




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


end of thread, other threads:[~1998-12-15 09:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-12-15 08:23 Unix dateformat ? Zsolt Varga <redax@agria.hu>
1998-12-15 09:11 ` George Moga <george@flex.ro>

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