Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Date is out by one day?
blizeH
✭✭
Hi guys,
Seem to have a small problem with the date on the forum - if you post something today, instead of letting you know when it was posted as a time, it just says 'February 6th' which of course was yesterday!
I'm guessing it's not a problem with the server time being out, as it almost seems like the comments are getting yesterdays date when being posted, but today's date is right when you're browsing the forum, if that makes sense :S
Any ideas what it could be please? I couldn't find any in the settings
Thanks
Seem to have a small problem with the date on the forum - if you post something today, instead of letting you know when it was posted as a time, it just says 'February 6th' which of course was yesterday!
I'm guessing it's not a problem with the server time being out, as it almost seems like the comments are getting yesterdays date when being posted, but today's date is right when you're browsing the forum, if that makes sense :S
Any ideas what it could be please? I couldn't find any in the settings
Thanks
0
Comments
When you see the time of today's post, it is calculated via some javascript stuff that makes out your timezone, and shows the correct date for the post.
For stuff that is yesterday (or before) for the server, time wise, I guess timing recalculation is done.
If I remember it tomorrow, I will try to browse the code to find out exactly how it works.
Cheers
Check php documentation. http://www.php.net/manual/en/function.date.php
If you're running your own server, you could change the default timezone too.
In bootstrap.php, you could change :
date_default_timezone_set('Canada/Saskatchewan');
I don't know where it should normally be set, as Garden tries to access it before (ini_get('date.timezone')), maybe php.ini
Is there *any* way to maybe make the date it stores the posts at as +1 day or something though? I only ask because for a few days of running Vanilla 2 it was fine, then suddenly the date went out. Also worth noting I have a Vanilla 1 installation on the very same server and the date is fine on that (and has been for around 3 years now!)
I think we've also identified a missing feature of Vanilla-- a timezone screen that shows the PHP timezone by default but allows overriding via a config param.
At the moment if I post something, it always shows yesterdays date, so it's like the date for storing the posts is different to the date that reads the posts? Will try disabling the add-ons we have quickly and see if it fixes itself
The javascript for displaying date is processed then. (maybe it puts something in the cookie, don't know)
How does Vanilla handle the time offset for those without JS? I can't remember right now ... but I imagine it just uses PHP's time zones, right? Would be awesome to use some kind of MaxMind/Geo IP product to locate where the IP address is, though I'm probably dreaming and it's overkill for just those without JS.