Re: Syntax for converting double to a timestamp

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org, Frank Church <voipfc(at)googlemail(dot)com>
Subject: Re: Syntax for converting double to a timestamp
Date: 2006-09-04 09:04:23
Message-ID: 0C55E7C8-9C33-484E-AF42-5578612BD583@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 4, 2006, at 17:58 , Alban Hertroys wrote:

> Peter Eisentraut wrote:
>> It's not clear what the meaning of a double precision as a
>> timestamp would be. How about you make that explicit:
>> "timestamp" * interval '1 second' + timestamp '1900-01-01 00:00:00'
>
> There's also 'EPOCH', which is shorter and more explicit.
>
> timestamp 'EPOCH" + "timestamp" * interval '1 second'

Note that epoch does not mean 1900-01-01 00:00:00.

select timestamp 'epoch';
timestamp
---------------------
1970-01-01 00:00:00
(1 row)

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2006-09-04 09:13:31 Re: Creating a date/time search function in Postgres.
Previous Message Alban Hertroys 2006-09-04 08:58:20 Re: Syntax for converting double to a timestamp