X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6C0BFD1B430 for ; Sun, 28 Dec 2003 06:05:27 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 30789-06 for ; Sun, 28 Dec 2003 02:04:39 -0400 (AST) Received: from quality.qadas.com (quality.qadas.com [204.227.16.4]) by svr1.postgresql.org (Postfix) with ESMTP id 1114BD1B42F for ; Sun, 28 Dec 2003 02:04:38 -0400 (AST) Received: from quality.qadas.com (localhost [127.0.0.1]) by quality.qadas.com (8.12.10/8.12.10) with ESMTP id hBS64LB3017186; Sat, 27 Dec 2003 23:04:21 -0700 (MST) Received: (from mfuhr@localhost) by quality.qadas.com (8.12.10/8.12.10/Submit) id hBS64LST017185; Sat, 27 Dec 2003 23:04:21 -0700 (MST) Date: Sat, 27 Dec 2003 23:04:21 -0700 From: Michael Fuhr To: "Seader, Cameron" Cc: pgsql-php@postgresql.org Subject: Re: SQL convert UTC to MST Message-ID: <20031227230421.A5893@quality.qadas.com> References: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local>; from CSeader@idahopower.com on Sat, Dec 27, 2003 at 04:37:32PM -0700 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/69 X-Sequence-Number: 2515 On Sat, Dec 27, 2003 at 04:37:32PM -0700, Seader, Cameron wrote: > I cannot figure this out, and im no SQL guru and would like to do this > with an SQL statement if i can. so far here is my SQL statement. > > SELECT * FROM t444d500009b5_4_6 ORDER BY utctime DESC > > What can i add here to have the column in this table converted from > UTC to MST. What data type is the utctime field? AT TIME ZONE converts between time zones, but its use varies depending on the data type you're working with. http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT -- Michael Fuhr http://www.fuhr.org/~mfuhr/