Re: int to date

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: int to date
Дата
Msg-id 20050725161435.GA16147@wolff.to
обсуждение исходный текст
Ответ на int to date  (Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>)
Список pgsql-sql
On Mon, Jul 25, 2005 at 10:54:42 +0200, Daniel Drotos <drdani@mazsola.iit.uni-miskolc.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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Daniel Drotos
Дата:
Сообщение: int to date
Следующее
От: jacekp@poczta.wprost.pl
Дата:
Сообщение: update vs unique index