Received: from hotmail.com (f41.law15.hotmail.com [64.4.23.41]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g02Lk2m43169 for ; Wed, 2 Jan 2002 16:46:05 -0500 (EST) (envelope-from tom_kreiner@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 2 Jan 2002 13:45:58 -0800 Received: from 64.80.187.3 by lw15fd.law15.hotmail.msn.com with HTTP; Wed, 02 Jan 2002 21:45:57 GMT X-Originating-IP: [64.80.187.3] From: "Tom Kreiner" To: pgsql-sql@postgresql.org Subject: Getting Hour From a Time in Different Time Zone Date: Wed, 02 Jan 2002 16:45:57 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 02 Jan 2002 21:45:58.0033 (UTC) FILETIME=[DCD53810:01C193D6] X-Archive-Number: 200201/12 X-Sequence-Number: 6103 I'm working on a web interface that will be taking into account that the users will be in different time zones. In one of my queries, I need to extract the hour of a time that has been converted to the appropriate time zone. Everytime I do this, the hour function gives me he hour in the server's time zone, not in the time zone I'm trying to convert to. For example, the server's time zone is -08. I'm in time zone -05. Assume that current_timestamp (for the server) is 9:00 AM. I know that: SELECT current_timestamp AT TIME ZONE INTERVAL '-05 hours'; gives me 12:00 PM, which is the correct time for my time zone. However, if I do: SELECT hour(timestamp(current_timestamp AT TIME ZONE INTERVAL '-05 hours')); I get 9. The server is returning the hour for it's designated time zone. In essence, it's undoing the time zone change. I need the hour for the converted time zone time. Has anyone else had this problem and found a solution for it? Thanks. Tom Kreiner tom_kreiner@hotmail.com _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx