selecting current UTC time

From: <davidn(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: selecting current UTC time
Date: 2008-09-14 10:10:09
Message-ID: f0e0f1b15551d000d53e665dd7c31d80@imap.xnet.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Is it possible to select the current UTC time as type timestamp with time
zone?

select localtimestamp;

2008-09-14 21:55:24.367796

select localtimestamp at time zone 'UTC';

2008-09-15 09:55:42.3478+12
(not sure if what this result is)

select current_timestamp;

2008-09-14 21:55:57.844422+12

select current_timestamp at time zone 'UTC';

2008-09-14 09:56:07.661157
(is type timestamp without time zone)

I know this seems like a simple problem but I have searched the archives
and am unable to find a solution.

Any ideas?

Thanks.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2008-09-14 12:55:18 Re: selecting current UTC time
Previous Message Scott Marlowe 2008-09-12 23:50:19 Re: Pls Hlp: SQL Problem