[drupal-devel] [task] Introduce Daylight Saving Time for Drupal

alliax drupal-devel at drupal.org
Wed Jan 26 16:46:23 UTC 2005


 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     tasks
 Priority:     normal
 Assigned to:  killes at www.drop.org
 Reported by:  killes at www.drop.org
 Updated by:   alliax
 Status:       patch

wouldn't hurt to have this feature in upcoming drupal.
I would use it for sure, my users are from the same place, with dst

alliax



Previous comments:
------------------------------------------------------------------------

September 26, 2004 - 04:01 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/dst.patch (6.04 KB)

Many people have wanted to have a Daylight Saving Time setting in the
past. If we use the "server time" modell (all times are displayed the
same around the world) this isn't all that hard to do.

I found a lot of usefull information here:
http://webexhibits.org/daylightsaving/g.html

The patch introduces a new DST setting and uses it if the "Configurable
time zones" setting is switched off.

------------------------------------------------------------------------

September 26, 2004 - 05:40 : gordon

This is a lovely patch, but you do realise that you have opened a can of
worms.

Daylight saving is a messy business, I had to write the Contestable
Electricity billing for a company here in Australia which had multiple
installations in multpile timezones, all with different daylight
savings rules, which impacted upon the bill. The way that dst is
legistated is very messy and here is Australia it is very messy.
Daylight savings don't follow state lines, as some towns that are very
close to the border may choose to follow the only the daylight saving
period of the next state, and when we had the olympics NSW went into
daylight savings months before anyone else. There are other examples of
weird things like even the 1 hour forward is not also true. I know that
in the 1999 change to daylight savings there was a small set of islands
north of New Zealand that went ahead by 2 hours as they wanted to be the
first into 2000.

>From what I can see of your patch it only allows for a single daylight
savings period for the entire system. Their can be situations where
there can be users from multiple countries and in different
timezones/dst.

I think that entire timezone system needs to looked at again, and maybe
re-implement it so that it will allow for dst. Maybe make it a bit more
user friendly so instead of setting up the timezone by name much like
how operating systems do it, and then this will automatically work out
the timezone.

+1 for this is something that would be good, but it still needs work.

------------------------------------------------------------------------

September 26, 2004 - 15:13 : Anonymous

The patch works as it is now. I had good reason to limit its capability
to the setting where users cannot chose their own timezone. ;)
I also assume that a server administrator knows if he has dst or not. I
also didn't (yet) cater for all countries where dst is in use mainly
because some insist on not giving a sensible rule for the change dates.

------------------------------------------------------------------------

September 26, 2004 - 23:54 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/dst_0.patch (6.04 KB)

The last comment was mine.

After a code review by Kjartan I provide a slightly improved patch.

I want to stress that solving the DST issue in a "suits everybody"
manner isn't the intention of this patch.
It solves the problem for people who have chosen to let all times on
their site be displayed in the server's time setting. By covering a
large portion of the earth's landmass I hope to be able to help most
site admins.

It would be possible to extend the patch to allow users to chose their
DST setting, too. In my experience, however, users tend to not care
about time settings at all. This may be EUrocentric though, as we have
only one time zone. Feedback is welcome.

------------------------------------------------------------------------

September 27, 2004 - 22:12 : drumm

+1

>From a code review I think this is an excellent solution. Could use a
little more comments in the section that sets $node->date to explain
the (probably good) reasoning behind that chunk of code. I don't have
anything resembling a good set of tests so I did not apply the patch
and try it.

------------------------------------------------------------------------

January 25, 2005 - 21:38 : killes at www.drop.org

I just want to point out that this patch still applies and would make
for a fine feature for Drupal 4.6...

-- 
View: http://drupal.org/node/11077
Edit: http://drupal.org/project/comments/add/11077





More information about the drupal-devel mailing list