2011-10-24 14 views

Respuesta

17
SELECT timestamp 'epoch' + time_in_millisec * interval '1 ms' 
FROM mytable; 

Ver la manual here.

2

Para milisegundos

SELECT timestamp 'epoch' + proyecto.fecha_inicio * interval '1 ms' 
from proyecto.proyecto 
where proyecto.fecha_inicio is not null 

Para segundo

SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720 * INTERVAL '1 second'; 

En el manual: http://www.postgresql.org/docs/current/interactive/functions-datetime.html.

Línea: .. "Aquí se muestra cómo puede convertir un valor de época a una marca de tiempo" ..

Cuestiones relacionadas