Re: Best practices: Handling Daylight-saving time - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Best practices: Handling Daylight-saving time
Date
Msg-id 1110571433.28555.25.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: Best practices: Handling Daylight-saving time  (Mike Benoit <ipso@snappymail.ca>)
List 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.

pgsql-general by date:

Previous
From: Mike Benoit
Date:
Subject: Re: Best practices: Handling Daylight-saving time
Next
From: Andrew Sullivan
Date:
Subject: Re: Replication suggestions (weak multi-master)