Closed (outdated)
Project:
Event
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2008 at 04:44 UTC
Updated:
13 Apr 2018 at 21:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
macgirvin commentedsubscribe
Comment #2
jody lynnCheck your site's timezone setting. If you have not set your site's timezone setting but your server (out of your control) has a timezone setting, then the day will change at the wrong time. Either set your site's timezone or change this function in event.module to the following so it ignores your server's timezone (remove the date("Z") stuff):
Comment #3
Vanhail commentedThis is a bug in the event module for version: 5.x-1.0. I assume it's been around for earlier versions. Pretty big bug in my opinion, dates need to be correct for an event module to be valid.
I have attached the patch, I just manually added the code and it worked for me. This thing drove me nuts.
BTW, I've seen this in multiple threads with no answer, so I'm posting this message in all of them. Blasted bug.
Comment #4
gthing commentedI applied the patch (actually I edited the code manually), but it made no change. My calendar still shows the wrong day.
If I go to administer date and time, the little previews show the wrong information as well. I checked my server and it is set to the correct date. So the question is where is the date being pulled from? Where can I set it?
Thanks.
Comment #5
jonny_noog commentedHello,
I have tried the solutions outlined in the above posts from Vanhail and Lynn and both seem to work for me... Kind of.
My timezone is GMT + 10 hours. Checked the server time, and the site wide Drupal time, both are correct.
Before applying either of these proposed patches, my event calendar was showing yesterday as the current day, highlighted in red.
If I apply either of these patches, it seems to start highlighting today as the current day in red, BUT still highlights yesterday in blue (when looking at the month view).
Can anyone comment on why it's highlighting yesterday in blue, and how I could stop this from happening?
I see that it is adding a 'selected' CSS class to yesterday, which I assume is the CSS class that makes yesterdays box blue... I guess I could always just mess with this style, or stop it from being applied somehow, but I don't know if this is a good solution... What does this 'selected' style usually signify?
Also, this is probably a really n00b question, but I see people posting "subscribe" in this thread... Is there some way to subscribe to this thread? Is that what this means?
Any assistance much appreciated.
EDIT: Found the subscribe feature... yay.
Comment #6
GoofyX commentedSubscribing...
Comment #7
gerhard killesreiter commentedI suggest to try the 5.x-2.x-dev version. Don't forget to backup your data.
Comment #8
johnhorning commentedThanks Vanhail! - worked for me.
Comment #9
johnhorning commented...
Comment #10
jasonsbytes commentedI went with Lynn's suggestion and that worked for me.
What I found was for this line:
return (time() - date("Z")) + variable_get('date_default_timezone', 0);time() -- returns seconds since epoch
date("Z") -- returns -18000 for me or -5 hours for US Central time
variable_get('date_default_timezone', 0) -- returns -18000 also.
So essentially it is subtracting -18000 (same as adding 18000) to time(), then it adds -18000 (same as subtracting it), so what I end up with is the original value of time() anyways, which is UTC time not counting for my TZ offset.
I'm not sure if this is an issue with the math or TZ settings or just bad logic...
Any thoughts? Either way, removing the date("Z") returns the correct value, so thanks Lynn.
I am now using this line:
return (time() + variable_get('date_default_timezone', 0));Comment #11
dean.p commentedThanks jasonsbytes, that worked for me :)
Even though my server was set to the right timezone, user TS, and even enabling/disabling configurable timezones didn't fix it... calendar was always showing the current day 1 day behind.
Sack
Comment #12
gthing commentedTurns out my calendar had user definable time zones enabled. This was causing all sorts of wonkyness. I took that settings off and then was able to set the system time correctly.
Comment #13
gthing commentedIs active development taking place on the events module? It seems very buggy - I've never gotten it working properly and now if I so much as enable the events module my whole site goes down. I've dumped the tables (the module had mangled all of the dates on every event anyway) and I still can't even get it to enable.
I've lost a year's worth of events on a production site now and have no way of getting things working again...
Comment #14
banjer commentedI did something similar, so if jasonsbytes' didn't work for you then try this. Its a little more work. My problem was that everyday at 9pm, the event calendar display would go to the next day. So this meant the event system thought my time was +3 hours ahead of what it actually was. So what I did was:
1. looked in event_timezones.inc (function event_get_timezones) for a timezone that is 3 hours ahead of mine (I'm on the east coast, so I chose Los Angeles). The offset for LA is -28800.
2. used the -28800 offset in the code change below in event.module:
Everything works great now. Someone proposed a similar idea in another issue, but I can't find it or else I'd link it here. I'll try jasonsbytes' idea later when I get a dev site set up.
Comment #15
prhodes commentedJust wanted to also report that jasonsbytes solution worked for me.
Thanks!
Comment #16
shanefjordan commentedOne thing I have noticed with the timezone issues (US Eastern) is that there is an issue with the DST (daylight savings time). I have a list of events with dates/times and everything is great until you get to november, then everything is off by an hour. This is after i've added the code to compensate for the date_default_timezone. Anyone have any ideas how to go about correcting this? It seems to me that most of the issues are with the fact that event is doing timezones and date is doing timezone.
Thanks,
Shane
Comment #17
japerryEvent for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.