Skip site navigation (1) Skip section navigation (2)

a question about dates and timestamp

From: Ange Michel POZZO <poange(at)technologist(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: a question about dates and timestamp
Date: 2000-08-03 08:24:38
Message-ID: 00080310393100.00710@ange.alpinfo.fr (view raw or flat)
Thread:
Lists: pgsql-sql
hi all

i have a table like this

id_message      int4 not null default nextval (  ...
id_abonne        int4 
texte_message  varchar() not null        
date_message   numeric not null  

the default size of numeric is 30.6

another table :

id_message  int4
id_abonne    int4
text_message text
date_message int4


in both case date_message is used to store a unix timestamp ( number of seconds
since 1st of 1970)

for example : 965340000  = 2000-08-03 00:00:00+02

my question is how can i convert the numeric or the int4 value to a date value?

which function should i use to make something like this work ?

select convert_to_date( date_message) from my_table;

2000-08-03 00:00:00+02
2000-08-01 13:56:00+02
etc etc


thanks in advance

Pozzo Ange

Responses

pgsql-sql by date

Next:From: Karel ZakDate: 2000-08-03 08:58:38
Subject: Re: a question about dates and timestamp
Previous:From: Carolyn Lu WongDate: 2000-08-03 05:13:32
Subject: What is happening?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group