Re: select current UTC time ?

From: Rainer Bauer <usenet(at)munnin(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: select current UTC time ?
Date: 2008-06-05 19:08:35
Message-ID: gceg449s5gsm0nl5sv3hrt4q7325rp9tcm@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

kevin kempter wrote:

>How could I select the current UTC time ? now() cast as a timestamp
>at UTC is wrong because it takes now() and says: if it were now() time
>UTC what would it be here (timezone) and returns that. I want to
>return 'what time is it now in UTC ?'

SELECT EXTRACT('epoch' FROM CURRENT_TIMESTAMP AT TIME ZONE 'UTC')::bigint::int

Rainer

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message kevin kempter 2008-06-05 19:12:21 Re: select current UTC time ? (SOLVED)
Previous Message kevin kempter 2008-06-05 19:01:13 select current UTC time ?