Skip to content

Instantly share code, notes, and snippets.

@MSch
Created November 24, 2012 08:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MSch/4138884 to your computer and use it in GitHub Desktop.
Save MSch/4138884 to your computer and use it in GitHub Desktop.
<msch> RhodiumToad: so the simple advice is, "always use timestamptz, never timestamp"?
<RhodiumToad> when storing a future time, the way to decide is this:
<RhodiumToad> there are a few apps where timestamp without time zone has its uses.
<RhodiumToad> e.g. things like calendaring / scheduling which are dealing mostly in future times
<RhodiumToad> does it matter how many seconds/minutes/hours there are between now and then,
<RhodiumToad> or does it matter what the clock on the wall will read then
<RhodiumToad> in the first case you need timestamptz, in the second case, timestamp without time zone,
<RhodiumToad> possibly with a separate field (possibly in some other table) storing the timezone name
<RhodiumToad> otherwise, you run into the same problem that many calendaring apps did when the US DST rules were changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment