Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-27 Thread Mark Morgan Lloyd
Tom Lane wrote: Steve Crawford writes: I think you may have confused yourself by the order of operations. This: ('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH TIME ZONE created a timestamp from some text and you specified the time-zone to be used in creating that value (stored int

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Tom Lane
Steve Crawford writes: > I think you may have confused yourself by the order of operations. This: > ('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH TIME ZONE > created a timestamp from some text and you specified the time-zone to be > used in creating that value (stored internally in

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Tom Lane
Mark Morgan Lloyd writes: > Thanks Tom. Timestamps are going into the database which are implicitly > UTC, and I was looking for a way to convert them when displayed to the > local timezone (the client gets this from a configuration file and puts > it in the query) and also to present the timez

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Steve Crawford
On 01/26/2011 09:00 AM, Mark Morgan Lloyd wrote: Tom Lane wrote: Mark Morgan Lloyd writes: SELECT to_char(('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH TIME ZONE, 'HH24:MI TZ'); to_char --- 12:00 GMT (1 row) You haven't said exactly what you were hoping to accompl

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Steve Crawford
On 01/26/2011 09:00 AM, Mark Morgan Lloyd wrote: Tom Lane wrote: Mark Morgan Lloyd writes: SELECT to_char(('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH TIME ZONE, 'HH24:MI TZ'); to_char --- 12:00 GMT (1 row) You haven't said exactly what you were hoping to accompl

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Mark Morgan Lloyd
Tom Lane wrote: Mark Morgan Lloyd writes: SELECT to_char(('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH TIME ZONE, 'HH24:MI TZ'); to_char --- 12:00 GMT (1 row) You haven't said exactly what you were hoping to accomplish, but I suspect the point here is to format a t

Re: [GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Tom Lane
Mark Morgan Lloyd writes: > SELECT to_char(('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP > WITH TIME ZONE, 'HH24:MI TZ'); >to_char > --- > 12:00 GMT > (1 row) You haven't said exactly what you were hoping to accomplish, but I suspect the point here is to format a time acco

[GENERAL] Getting the name of the timezone, adjusted for daylight saving

2011-01-26 Thread Mark Morgan Lloyd
Running 8.4.6 hosted on Linux, if I do this... SELECT to_char('2011-03-01 12:00' AT TIME ZONE 'GMT0BST', 'HH24:MI TZ'); to_char - 12:00 (1 row) ..I don't get a timezone- I can live with that. If I do this... SELECT to_char(('2011-03-01 12:00' AT TIME ZONE 'GMT0BST')::TIMESTAMP WITH