PEAK XOOPS - Recurring Event (Summertime) Problem SOLVED and other hacks in englishin japanese

Recurring Event (Summertime) Problem SOLVED and other hacks

List posts in the topic

question Recurring Event (Summertime) Problem SOLVED and other hacks

msg# 1
depth:
0
Previous post - Next post | Parent - Children.1 .2 .3 | Posted on 2004/8/30 14:48
AZNative  一等兵 From: Phoenix, Arizona, USA  Posts: 12
As many of you, the issue with recurring events was driving me crazy. This caused problems for me specifically because my servers are in a state that observes summertime while my state does not.

The problem was noticeable when creating a recurring event that overlapped a change in summertime. This would be October/November and April/May. Events would be off by one hour and all-day events would span multiple days. This happens because the physical servers are set to adjust for summertime automatically. Thus, any PHP calls involving date would inherit the summertime rules and then insert the inappropriate date into the database. Of course, this would easily be solved if web hosts wouldn't use summertime.

I've solved the problem by using GMT dates for the recurring events in the PHP code instead of the event time and then letting the database automatically do the proper adjustment for me by using a MySql method.

There is a side-effect to this change that you must be aware of. It is very minor compared to the summertime issue. Let's say you create an event from 10:00 - 14:00 that recurs every Wednesday. Each instance of that event will be 10:00-14:00. When you get to summertime/wintertime, it will not change by one hour. It will always be scheduled with the same start and end time, regardless.

For all-day events, let's say you schedule an all-day, recurring event for the 15th of each month. No matter what time zone the user is in, the event will always shows as all-day for the 15th. Even if the user is in a different time zone than where the event is occurring, the
event will show on the day in the location the event was scheduled.

I think most people can figure it out from here. I did do some testing of this code, but you may experience other issues. If you do, please let me know and I'll see if I can get them fixed. I may not be able to get to it right away however. If you can't wait, then either live with the hack or rollback to the old code.

In addition to the summertime/wintertime changes, I also made other changes so that all times are in 12 hours format using am/pm instead of the 24-hour clock.

I will make a separate post for each of the hacks, so please continue to read my other posts for the hacks.

IMPORTANT NOTE: This code works with MySql only since the database inserts were changed to use the UNIX_TIMESTAMP method in MySql. DO NOT IMPLEMENT THESE CHANGES UNLESS YOU ARE USING MYSQL. I do no warrant the code and I'm not responsible for any problems your website incurs due to this code. You implement this code at your own risk
Votes:1 Average:0.00

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!