Page 1 of 1

Birthdays on Calendar 1 day off.[Solved (in 1.4.1)]

PostPosted: Wed Dec 06, 2006 5:53 pm
Author: Drop-Forged
For some reason there are a handful of members on my site whos Calendar is showing the birthdays one day early.


Now normally this would not be a big deal, but they are pretty good at wishing other members Happy Birthday when it is their birthday, and there are a lot of premature post, and people would like to see this issue fixed.

Ive tried to find the answer, and there was an issue with the Topic Calendar and time zones, but it appears all the fixes are already in place.

Does anyone know how to fix this issue??? <img>

PostPosted: Wed Dec 06, 2006 6:05 pm
Author: IntegraMOD
Check the server time zone and the users ofset time

Re: Birthdays on Calendar 1 day off.

PostPosted: Wed Dec 06, 2006 6:19 pm
Author: Drop-Forged
The System Time is set to GMT à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒ ¢Ã¢â€š ¬Ã…“ 4 hours, which is what works to make everyone elses settings correct.

And the Users who are having this issue have theirs set correct as well (The ones I checked).

And some even have the same time zone as I do GMT à¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒ ¢Ã¢â€š ¬Ã…“ 5 hours, and mine works fine, and theirs is a day offà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ <img>

PostPosted: Wed Dec 06, 2006 6:28 pm
Author: IntegraMOD
Are the users that ar having the problems seeing the post times correct?

For example if they post a test message does the post time correspond to their local/computer time?

Re: Birthdays on Calendar 1 day off.

PostPosted: Wed Dec 06, 2006 7:58 pm
Author: Drop-Forged
Yes, they see their post times correctly.

Re: Birthdays on Calendar 1 day off.

PostPosted: Thu Dec 07, 2006 2:13 am
Author: Drop-Forged
Ok, I searched the other site and found out that Im the only one with this problem.
While it appears Toast found the cause, it doesnt look like anyone produced a fix yet.

[url=http]Here is the link to the topic.[/url]

Here is what Toast came up with as the cause]thanks for the kind words, Dave. since getting the code and looking at the database structure last night, I've been able to get a better idea of what's going on here.

Here's the problem. Birthdays are stored in the database as simply a date. Displaying birthdays, however uses timestamps. translating from a date to a timestamp sets the persons birthday time to be 00:00, midnight, of their birthday.

in calendar_scheduler.php
Code: Select all
$template->assign_block_vars('hour', array(         'CLASS'       => $color,         'HOUR'       => $l_hour,         'U_HOUR'     => append_sid("./calendar_scheduler.$phpEx?" . (($i==0) ? '' ]

In this particular case, the server time, which is used to calculate current time, is set to GMT -5.  However, event display is tied to a user's timezone.

in functions_calendar.php inside the display_calendar function
[code]$format = ( intval(date('Ymd', $offset_date)) == intval(date('Ymd', cal_date(time(),$board_config['board_timezone']))) ) ? '<b>%s</b>' ], $offset_date)),                 'U_DATE'     => append_sid($phpbb_root_path . "./calendar_scheduler.$phpEx?d=" . $offset_date . "&fid=$fid"),                 )             );


so, as you can see, in cases where the user's timezone is earlier than the server's time, events timestamped less than the timezone difference will be displayed incorrectly.

One solution could be removing the call to cal_date in events display. Another would be to break birthdays out with separate formatting than other events.[/quote]

Does anyone know how to fix this???

Re: Birthdays on Calendar 1 day off.

PostPosted: Thu Dec 07, 2006 9:01 am
Author: Teelk
I believe it was evolver that fixed this in IM141, but I think it's too large a change to provide a simple patch I'm afraid.

Re: Birthdays on Calendar 1 day off.

PostPosted: Thu Dec 07, 2006 3:01 pm
Author: Drop-Forged
Ok, if it is fixed in 141, all is good.

I will just let them know that it should be fixed on the next site update... :D

PostPosted: Fri Feb 02, 2007 12:24 am
Author: ScottDaMan
I have IM141 installed and I can say this is not fixed. It is showing birthdays one day early.

PostPosted: Sat Feb 03, 2007 6:47 pm
Author: IntegraMOD
have you set the board timezone correct? ie the timezone of the server where the board is held?

PostPosted: Sun Feb 04, 2007 11:13 pm
Author: ScottDaMan
Yeah, I have. I found the timezone by just uploading something through FTP and noting the hour difference. My new topic on this: http://www.integramod.com/forum/viewtop ... highlight=