If you are here reading this article it means your anonymous users are seeing wrong dates, probably a back date. However, when you log in as an admin it shows you the correct date. As a drupal administrator you might care less about admin user but you care more about your readers that is your anonymous users. As all things in life there is a simple solution to this one too.
Understanding how to solve
Before I walk you through the solution can you make a guess what could be wrong? The dates for admin are correct but for anonymous users it is wrong. That means Drupal reads the correct dates from system (that is why admin gets correct dates) but it is displaying a back date for anonymous users. My first guess was that it is a permission issue. However, there are no such permissions to revoke or allow. Also, since the anonymous users can see the dates they do not have any such restrictions. Right? Looking at the facts once more I realized that the dates are from past that means there is a way where I am reading the data from the past.
The solution
If you jumped to this section skipping the last section you missed an important part. I am pretty good at Drupal today but it took me a long time to understand the process of debugging. Therefore, I highly recommend you to read the last section for your own good.
The solution as we guessed in the last article is clearing the stale data. What do we call such data? Cache, right? The dates that it was reading were from cached data. All I had to do was to go to Admin->Performance and then click on "clear cache data". Moreover, to avoid this problem in future one should shut the caching off for anonymous users. Hope this helps.
Thanks for posting this. In my case, I found that Anonymous consistently showed the wrong dates (one back) across all my events with repeating dates. Turned out, in this case, what was:
ReplyDeletestart 04/22/2011 12:00am
end 04/22/2011 12:00am
to be:
start 04/22/2011 1:00am
end 04/22/2011 11:45pm
Note: 12:00am was no good, and 11:59p rounded itself up to 12:00a..
Dear Bronius,
ReplyDeleteWere you able to fix your problem with this? I would love to know if you had another solution.
Regards,
Programmer
This fixed my issue - thank you! I also disabled block caching on the site I was working on to hopefully avoid this in the future. Thank you!
ReplyDelete