From: Aurynn Shaw <ashaw@commandprompt.com>
To: "Valter Douglas Lisbôa Jr." <douglas@trenix.com.br>
Cc: pgsql-sql@postgresql.org
Subject: Re: Timestamp, epoch and a bit confusion
Date: Wed, 12 Mar 2008 16:58:07 -0600
Message-ID: <47D85FFF.20300@commandprompt.com> (raw)
In-Reply-To: <200803121936.14106.douglas@trenix.com.br>
References: <200803121936.14106.douglas@trenix.com.br>
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@commandprompt.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ashaw@commandprompt.com, douglas@trenix.com.br
Subject: Re: Timestamp, epoch and a bit confusion
In-Reply-To: <47D85FFF.20300@commandprompt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox