pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Crawford <scrawford@pinpointresearch.com>
To: Seader, Cameron <CSeader@idahopower.com>
To: pgsql-php@postgresql.org
Subject: Re: SQL convert UTC to MST
Date: Mon, 29 Dec 2003 14:02:35 -0800
Message-ID: <200312291402.35789.scrawford@pinpointresearch.com> (raw)
In-Reply-To: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local>
References: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local>

On Saturday 27 December 2003 3:37 pm, 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. any input would be helpful
> Thanks,

Depends. If the data is an INT (seconds from the epoch) and your 
timezone is set correctly then abstime(utctime) should give you local 
time (adjusted appropriately for Daylight Saving).

What is the data type of utctime?

Cheers,
Steve




view thread (3+ messages)

Message-ID: <200312291402.35789.scrawford@pinpointresearch.com>
Permalink:  ../200312291402.35789.scrawford@pinpointresearch.com/
Also on:    postgresql.org/message-id/200312291402.35789.scrawford@pinpointresearch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: scrawford@pinpointresearch.com, CSeader@idahopower.com
  Subject: Re: SQL convert UTC to MST
  In-Reply-To: <200312291402.35789.scrawford@pinpointresearch.com>
  References: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local> <200312291402.35789.scrawford@pinpointresearch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox