Search Postgresql Archives

Re: Money casting too liberal?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-03-28, Gavin Flower <GavinFlower@xxxxxxxxxxxxxxxxx> wrote:

>
> Hmm... This should optionally apply to time. e.g. 
> time_i_got_up_in_the_morning should reflect the time zone where I got up 
> - if I got up at 8am NZ time then this should be displayed, not 12pm (12 
> noon) to someone in Los Angeles or 3am in Tokyo! (have a 'localtime' 
> data type?- possibly add the timezone code if displayed in a different 
> time zone.)

it was 12 noon in LA when you got up.
if you want the local time of the even you can specfy where you want it

 at time zone 'Pacific/Auckland'
 at time zone 'NZDT'    -- note: some names are ambiguous eg: 'EST'
 or
 at time zone '-13:00'  -- note: offsets are ISO, not POSIX

getting the local time of the even This requires that you store the locale, zone name , or offset when
you store the time.

or you could just cast it to text when you store it... 


how confusing is 'EST' ? 
worse than this:

set datestyle to 'sql,dmy';
set time zone 'Australia/Brisbane';
select '20130101T000000Z'::timestamptz;
set time zone 'Australia/Sydney';
select '20130101T000000Z'::timestamptz;
set time zone 'America/New_York';
select '20130101T000000Z'::timestamptz;

-- 
⚂⚃ 100% natural



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux