Re: Money casting too liberal?

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: Money casting too liberal?
Дата
Msg-id 515A8B62.8090300@archidevsys.co.nz
обсуждение исходный текст
Ответ на Re: Money casting too liberal?  (Jasen Betts <jasen@xnet.co.nz>)
Список pgsql-general
On 29/03/13 12:39, Jasen Betts wrote:
On 2013-03-28, Gavin Flower <GavinFlower@archidevsys.co.nz> 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'orat 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;

Sorry, I was at my Mum's for a few days with 'limited' Internet access - they have a much lower quota than I normally have...

Yes I could store the timezone separately, but semantically it makes sense to store the local time & its time zone as a unit, less likely to have bugs when someone else (or myself in a years time) go to make amendments.

Storing in text is fine for display, but if I then have to also relate different local times to a common timeline, then text would not be so convenient.

To be honest this is current moot, as I don't have a need for this at the moment. Having said that, I realize I am tempting the gods into making so that I do need it!


Cheers,
Gavin

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephen Scheck
Дата:
Сообщение: Dynamic/polymorphic record/composite return types for C user-defined-functions
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Money casting too liberal?