Re: Best practices: Handling Daylight-saving time

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Mike Benoit <ipso(at)snappymail(dot)ca>
Cc: Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Best practices: Handling Daylight-saving time
Date: 2005-03-11 20:03:54
Message-ID: 1110571433.28555.25.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2005-03-11 at 13:47, Mike Benoit wrote:
> Not exactly...
>
> Here is a scenario I ran in to with collecting bandwidth usage and
> displaying it back in graph form to customers.
>
> You can store the timestamps in GMT, but the customer wants to see when
> spikes happen in his localtime, which most likely has DST. So twice a
> year, you are either compressing two hours of bandwidth usage into one,
> or the opposite, stretching one hour in to two, which of course produces
> somewhat odd looking graphs during that time.
>
> Besides making note of DST on the graph so the customer can see it, I
> haven't found a elegant solution to this problem.

I would think that if you stored them with the local timezone, and used
AT TIME ZONE to convert them to GMT for sorting, then they should show
up in the right order. Just a guess.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2005-03-11 20:25:52 Re: Replication suggestions (weak multi-master)
Previous Message Mike Benoit 2005-03-11 19:47:24 Re: Best practices: Handling Daylight-saving time