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

* epoch to date
@ 2002-10-03 15:09 Roberto Mello <rmello@cc.usu.edu>
  2002-10-03 15:42 ` Re: epoch to date Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Roberto Mello @ 2002-10-03 15:09 UTC (permalink / raw)
  To: pgsql-sql

Hi all,

Maybe I missed something obvious, but is there a built-in function to
convert epoch to date? I couldn't find it in the documentation for extract
and friends.

Thanks,

-Roberto

-- 
+----|        Roberto Mello   -    http://www.brasileiro.net/  |------+
+       Computer Science Graduate Student, Utah State University      +
+       USU Free Software & GNU/Linux Club - http://fslc.usu.edu/     +
All in all, you're just another brick on the wall...



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

* Re: epoch to date
  2002-10-03 15:09 epoch to date Roberto Mello <rmello@cc.usu.edu>
@ 2002-10-03 15:42 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Achilleus Mantzios @ 2002-10-03 15:42 UTC (permalink / raw)
  To: Roberto Mello <rmello@cc.usu.edu>; +Cc: pgsql-sql

On Thu, 3 Oct 2002, Roberto Mello wrote:

> Hi all,
>
> Maybe I missed something obvious, but is there a built-in function to
> convert epoch to date? I couldn't find it in the documentation for extract
> and friends.

well to compute epoch timestamp

# SELECT (now() -(extract(epoch from now())::int4)/86400)::datetime ;

if thats what you asked :)
>
> Thanks,
>
> -Roberto
>
> --
> +----|        Roberto Mello   -    http://www.brasileiro.net/  |------+
> +       Computer Science Graduate Student, Utah State University      +
> +       USU Free Software & GNU/Linux Club - http://fslc.usu.edu/     +
> All in all, you're just another brick on the wall...
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr




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

* epoch to date?
@ 2003-05-08 19:44 Alex Rice <alrice@ARCplanning.com>
  2003-05-08 19:54 ` Re: epoch to date? Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 4+ messages in thread

From: Alex Rice @ 2003-05-08 19:44 UTC (permalink / raw)
  To: pgsql-sql

I have a column with seconds since the unix epoch. How to convert it to 
date? Sorry I couldn't find it in the docs.

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alrice@ARCplanning.com
alrice@swcp.com




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

* Re: epoch to date?
  2003-05-08 19:44 epoch to date? Alex Rice <alrice@ARCplanning.com>
@ 2003-05-08 19:54 ` Bruno Wolff III <bruno@wolff.to>
  0 siblings, 0 replies; 4+ messages in thread

From: Bruno Wolff III @ 2003-05-08 19:54 UTC (permalink / raw)
  To: Alex Rice <alrice@ARCplanning.com>; +Cc: pgsql-sql

On Thu, May 08, 2003 at 13:44:22 -0600,
  Alex Rice <alrice@ARCplanning.com> wrote:
> I have a column with seconds since the unix epoch. How to convert it to 
> date? Sorry I couldn't find it in the docs.

One way is:
select 'epoch'::timestamp + 1234 * '1 second'::interval;

Another is:
select 1234::abstime;




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


end of thread, other threads:[~2003-05-08 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 15:09 epoch to date Roberto Mello <rmello@cc.usu.edu>
2002-10-03 15:42 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
2003-05-08 19:44 epoch to date? Alex Rice <alrice@ARCplanning.com>
2003-05-08 19:54 ` Re: epoch to date? Bruno Wolff III <bruno@wolff.to>

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