Why data of timestamptz does not store value of timezone passed to it?
От | rohtodeveloper |
---|---|
Тема | Why data of timestamptz does not store value of timezone passed to it? |
Дата | |
Msg-id | BAY178-W3669708526DF1D0A97C3BAC4DA0@phx.gbl обсуждение исходный текст |
Ответы |
Re: Why data of timestamptz does not store value of timezone passed
to it?
Re: Why data of timestamptz does not store value of timezone passed to it? |
Список | pgsql-hackers |
<div dir="ltr">Hi,all<br /> <br /> I have a question about data type "timestamp with time zone".<br />Why data of timestamptzdoes not store value of timezone passed to it?<br /><br />Considering the following example.<br /> <br /> postgres=#select '2014-08-28 14:30:30.423602+02'::timestamp with time zone;<br /> timestamptz <br />-------------------------------<br/> 2014-08-28 20:30:30.423602+08<br />(1 row)<br /> <br /> The timezone of output(+08)is different with the original input value(+02).<br />It seems not to be good behavior.But the behavior of datetype "time with time zone" is correct.<br /> <br /> postgres=# select '14:30:30.423602+02'::time with time zone;<br/> timetz <br />--------------------<br /> 14:30:30.423602+02<br />(1 row)<br /> <br /> If the correntbehavior of timestamptz is not suitable,is there any plan to correct the behavior of timestamptz or create a new datatype which can store timestamp with timezone?<br /> <br /><br />*)manual-->8.5.1.3. Time Stamps<br />---------------------------------------------------------<br/>For timestamp with time zone, the internally stored valueis always in UTC (Universal Coordinated Time, traditionally known as Greenwich Mean Time, GMT). An input value thathas an explicit time zone specified is converted to UTC using the appropriate offset for that time zone. If no time zoneis stated in the input string, then it is assumed to be in the time zone indicated by the system's TimeZone parameter,and is converted to UTC using the offset for the timezone zone.<br />---------------------------------------------------------<br/> <br /> <br /> <br /> Best regarts<br /> rohto<br /> <br/> <br /> <br /> <br /> <br /> rohto<br /></div>
В списке pgsql-hackers по дате отправления: