![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? Suppose a linux server with system clock set to utc. thanks for the light you will certainly shed on this... /Str. |
#3
| |||
| |||
|
|
On 28 Apr., 18:00, "M. Strobel" <sorry_no_mail_h... (AT) nowhere (DOT) dee wrote: Hi, I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? Suppose a linux server with system clock set to utc. thanks for the light you will certainly shed on this... /Str. some light... http://en.wikipedia.org/wiki/Tz_database |
#4
| |||
| |||
|
|
I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? |
#5
| |||
| |||
|
|
M. Strobel, 28.04.2011 18:00: I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? From the manual at: http://www.postgresql.org/docs/curre...TYPE-TIMEZONES All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the timezone configuration parameter before being displayed to the client. |
#6
| |||
| |||
|
|
Am 29.04.2011 08:45, schrieb Harry Tuttle: M. Strobel, 28.04.2011 18:00: I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? From the manual at: http://www.postgresql.org/docs/curre...TYPE-TIMEZONES All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the timezone configuration parameter before being displayed to the client. And I can _not_ conclude from this that a date/time without timezone is not stored in utc, right? The server clock is set to utc. So where does the difference show up? |
#7
| |||
| |||
|
|
Hi, I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? |
|
My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? |
#8
| |||
| |||
|
|
timestamp is internally stored with no zone translation so '2011-04-30 23:02:39.296282' will look the same whatever the user uses for their timezone. (different datestyle settings can effect the date part however) |
#9
| |||
| |||
|
|
On 2011-04-28, M. Strobel <sorry_no_mail_here (AT) nowhere (DOT) dee> wrote: Hi, I did not quite understand the use case of timestamp with time zone. When do you need 'with time zone'? it's best to use it when you are dealing with real events that happen at a specific instant My tests show you can calculate other time zones time easily from a timestamp without time zone. Is timestamp internally stored normalized to utc, and calculated to client time zone? Or to server time zone? timestamp with timezone is internally stored as a UTC timestamp no zone information is stored. So '2011-04-30 23:02:39.296282+12' is actually stored as '2011-04-30 11:02:39.296282 UTC'. (I know it says "with timezone" on the label - postgresql fakes it ) (actually it's stored as a number, not as a string) When it's retreived it will be translated to the best guess zone apropriate for the user (using the server operating system's timezone database) timestamp is internally stored with no zone translation so '2011-04-30 23:02:39.296282' will look the same whatever the user uses for their timezone. (different datestyle settings can effect the date part however) I see. So there is no automatic translation 'without time zone', |
#10
| |||
| |||
|
|
I see. So there is no automatic translation 'without time zone', but if you ask the system to translate it to another time zone it does so assuming local time. Thanks, I thought it was too much work to set up tests within different time zones... |
![]() |
| Thread Tools | |
| Display Modes | |
| |