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

Re: Timestamp, epoch and a bit confusion

From: Aurynn Shaw <ashaw(at)commandprompt(dot)com>
To: "Valter Douglas Lisbôa Jr(dot)" <douglas(at)trenix(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Timestamp, epoch and a bit confusion
Date: 2008-03-12 22:58:07
Message-ID: 47D85FFF.20300@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-sql
Valter Douglas Lisbôa Jr. wrote:
> Hello all.
> 
> I working with postgreSQL for a couple of months, and now I trying to convert 
> timestamp columns in epoch and epoch to timestamp columns. So far I could 
> reach, all SQL I find by 'googling' returns an error.

SELECT extract (epoch from your_time_field) from your_table;
SELECT to_timestamp(your_epoch_field) from your_table;

> 
> Where can I find some documentation with this convertions fo 8.2.x branch? I 
> think the Manual on the main site is not very helpfull in this case!!! ;-(
> 

And you can check out the docs @
http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT


Hope that helps,
-- 
Aurynn Shaw

The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 103
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

ashaw(at)commandprompt(dot)com

In response to

Responses

pgsql-sql by date

Next:From: Valter Douglas Lisbôa Jr.Date: 2008-03-13 00:41:01
Subject: Re: Timestamp, epoch and a bit confusion
Previous:From: Valter Douglas Lisbôa Jr.Date: 2008-03-12 22:36:13
Subject: Timestamp, epoch and a bit confusion

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