'NOW' in UTC with no timezone

From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: 'NOW' in UTC with no timezone
Date: 2004-10-12 05:04:20
Message-ID: 416B65D4.7020402@stuartbishop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

I'm trying to determine the best way of saying 'The current time in UTC
with no time zone information'.

I'm currently using CURRENT_TIMESTAMP AT TIME ZONE 'UTC' and inserting
into columns defined as TIMESTAMP WITHOUT TIME ZONE which appears to
work. However, PostgreSQL parses this into the much more confusing
"timezone('UTC'::text, ('now'::text)::timestamp(6) with time zone)"
which is what is appearing on my generated documentation.

Is there any magic string like 'NOW'::timestamp or CURRENT_TIMESTAMP
which returns UTC time?

- --
Stuart Bishop <stuart(at)stuartbishop(dot)net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBa2XUAfqZj7rGN0oRAkLJAJ9vOWl1hDSbubKQUnCSvBZg8nzvwACdFjvV
9vACiPZyhnXjlLZuTbGoUrs=
=gEL/
-----END PGP SIGNATURE-----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric D. Nielsen 2004-10-12 05:11:07 Need some advice on appropriate PL strategy...
Previous Message Oliver Jowett 2004-10-12 04:55:27 Re: Avoiding explicit addDataType calls for PostGIS