Print

Print


On Fri, Mar 25, 2011 at 6:14 AM, graham <[log in to unmask]> wrote:
> We've just gone live with OpenRoom, got a lot of student response - and
> have run into a problem I think is due to incorrect handling of the
> change to daylight saving time (this is in the UK). The problem is the
> display is out of sync with the data in the database, and as a result
> the system is letting students make duplicate bookings causing further
> problems. We've turned it off for now - but I wonder if anyone else has
> run into this problem and has a quick fix?

I'm not sure about the quick fix, but the ideal long-term solution is
to abolish "daylight saving time" worldwide.  It has certainly caused
more problems than it has solved... [remainder of rant omitted, due to
gmail message size limitations]

Some questions to help diagnose the problem:
  1. Which dates are affected?  Just those after the time change? (UK
changes this weekend, right?)
  2. How are the dates actually stored? (UTC, local time, Unix timestamp?)
  3. Are the stored times correct?  (i.e. is the error occurring on
input, or on output?)

If the dates are being stored as text strings like "2011-03-28
09:00:00" that are getting processed by the PHP strtotime() function
(OpenRoom runs on PHP, right?), then you can force a particular
timezone interpretation by appending the timezone info
("Europe/London" or whatever) to the end of the string before
processing with strtotime().

Good luck,
Keith