Re: day_trunc and day duration in a remote time zone

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: day_trunc and day duration in a remote time zone
Date: 2013-10-17 16:59:16
Message-ID: 52601764.6080800@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/17/2013 08:47 AM, Marc Mamin wrote:
> Hello,
> I want to retrieve the day start and duration of an epoch within a
> given time zone
> and return the day start as epoch.

Not quite sure what you are looking for, but something like:

hplc=> select current_date::timestamp, extract(epoch from
current_date::timestamp);

timestamp | date_part
---------------------+------------
2013-10-17 00:00:00 | 1381968000

> regards,
> Marc Mamin

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Kerr 2013-10-17 17:29:52 Re: PostgreSQL vs Mongo
Previous Message Svetlin Manavski 2013-10-17 16:56:17 Re: Idle transactions in PostgreSQL 9.2.4