Re: Function to convert from (integer) UNIXTIME to DATETIME

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Morten W(dot) Petersen" <morten(at)src(dot)no>, pgsql-general(at)postgresql(dot)org
Subject: Re: Function to convert from (integer) UNIXTIME to DATETIME
Date: 2000-06-27 01:30:49
Message-ID: 395803C9.4F024116@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> You can cast an integer representing Unix timestamp directly to
> abstime...

Or directly to timestamp (which may pass through abstime on the way):

lockhart=# select timestamp(962057134);
timestamp
---------------------------
2000-06-26 22:05:34.00+00
(1 row)

Probably works for 6.5.x too.

- Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2000-06-27 01:36:56 Re: Conversion from MS Access to Postgresql
Previous Message Richard Harvey Chapman 2000-06-27 01:05:12 Inserting all defaults