From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | Daniel Drotos <drdani(at)mazsola(dot)iit(dot)uni-miskolc(dot)hu> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: int to date |
Date: | 2005-07-25 16:14:35 |
Message-ID: | 20050725161435.GA16147@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Mon, Jul 25, 2005 at 10:54:42 +0200,
Daniel Drotos <drdani(at)mazsola(dot)iit(dot)uni-miskolc(dot)hu> wrote:
> Hi,
>
> I have a string containing hexa dump of an 4 bytes integer, like
> '6AF4805C'. Is it possible to convert it somehow to date type in
> plpgsql (v8.0.0-rc1)? Doc says that date is represented as 4 bytes
> internaly.
>
> How can I get internal representation of a date type field? So I would
> be able to produce hexa dump of it like above...
area=> select x'6AF4805C'::integer::abstime;
abstime
------------------------
2026-11-11 08:49:00-06
(1 row)
It looks like the your number probably isn't an offset in seconds from
January 1 1970. But with more knowledge about what it is, you should
be able to turn it into a date or timestamp.
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2005-07-25 16:52:49 | Re: update vs unique index |
Previous Message | jacekp | 2005-07-25 12:58:43 | update vs unique index |