Time zone does not appear to work; MW 1.18; AWC 2.5.12
From Another Web Company
Viewed 187 times, With a total of 13 Posts
Have a suggestion, improvement, change or non-beta Forum Entension bug ? Please add them to the todo list
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 7:21:49 AM - Tuesday 24th, January 2012 |
|
I am not sure if I am failing to correctly configure this, or just a bug with the latest MW release.
MW version: 1.18.0
AWC form version: 2.5.12
I have made a few test posts to my newly-installed forum on my wiki, and it seems that the time stamps for those posts do not match what they should. On "my preferences" -> "Date and time" I set the "Time zone" drop-down menu to my local time zone. However, when I view posts that I make in the forum, they are time-stamped one hour after they should be.
Is there another setting that I should have entered somewhere? Am I the only one who has experienced this? Or is it a bug?
Thanks in advance.
Edit:
In case this helps, here are the other version numbers for my setup:
PHP 5.2.17 (cgi-fcgi)
MySQL 5.1.56
|
|
Edited On 3:23:49 PM - Tuesday 24th, January 2012 by Lost Student
|
|
|
|
|
|
Gets Around
Wiki Edit 5
Threads 9
Posts 101
|
|
| 10:09:50 AM - Tuesday 24th, January 2012 |
|
Hi Lost Student,
could it be that the server you run has a different timezone/time set?
My wiki personal preferences is time zone : Other and in the box underneath it says "System".
|
|
| What's the difference between a duck ? O.o
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 3:17:52 PM - Tuesday 24th, January 2012 |
|
Thanks for the response, Dutchman. I tested it just now--a change to a wiki page shows the correct revision time for that page; it's only the forum posts that are one hour off. The preferences drop-down menu has at the top "Use Wiki Default (America/Chicago)"--which happens to be what the forum posting times are showing.
Is there a chance that the extension is ignoring my preference for timezone and just going with the default?
As another note, right above the drop-down to select time zone in personal prefs, the "server time" is six hours ahead of the "default" time.
A few other quick tests I just conducted:
- If I change the timezone to the Chicago time zone in my user preferences, the posted time for both wiki page revisions and forum posts is correct (if I were in the Central time zone).
- If I change the time zone to New York, the wiki page revision times change accordingly, but the forum posts remain as if I were in the Central time zone.
Any help would be much appreciated.
|
|
|
|
|
|
Gets Around
Wiki Edit 5
Threads 9
Posts 101
|
|
| 9:09:42 AM - Wednesday 25th, January 2012 |
|
Darn i must pass. I live in Europe and really don't have a clue.
Hopefully someone else can help you out.
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 7:43:14 PM - Wednesday 25th, January 2012 |
|
Thanks for trying. I just realized that the problem may lie further down in MediaWiki than just this extension: when I signed a message on a talk page (using Liquid Threads Extension]) with the four ~, the time stamp left there is the same incorrect time stamp that shows up on forum posts. The strange thing is that the correct local time is shown on both Special:RecentChanges and the automatic Liquid Thread time stamp there. The incorrect timestamp even indicates that it is Central Time (CST) (See this screen cap for what I am talking about. The timestamp in line with the text "This is a test for timestamp" was generated by 4~, where the timestamp just below that was generated by Liquid Threads extension)
So, it is very strange. Apparently, MediaWiki has another variable where I need to set the local timezone, and some functions (like RecentChanges and Liquid Threads) read from one place, while others (like signing with the four ~ and AWC Forum extension) read from the other. I am going to investigate and if I ever find anything, I'll try to report back here.
Lost Student Jan 25th 4:35 pm Local Time
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 7:26:55 AM - Saturday 28th, January 2012 |
|
Well, I've tried to dig around the code for a little and I'm not sure I'm any closer to figuring out what is going wrong with my setup. Here is what I now know about how MediaWiki (and AWC Forum) deals with timezones (basically I just tried to follow the code to reconstruct how AWC Forum determines what time and date to output):
The MediaWiki function userAdjust() (found in languages/Language.php) receives an integer representing the date and time and adjusts for the amount entered as the second parameter.
AWC's function convert_date(), found in awc/forums/includes/funcs.php, utilizes userAdjust() to adjust the time zone and then output in either short or long format. convert_date() uses $awcUser->timecorrection as the offset amount (which is grabbed from MediaWiki $wgUser->mOptions['timecorrection']).
In awc/forums/includes/post_phase.php, $info['date'] uses the convert_date function to output the correctly-shifted date in long format. That string is then shown above every post as the posted date.
To summarize, everything looks like it should work properly and I am now stuck. If anybody that is running the same versions as me (AWC Forum 2.5.12) is willing to run a quick experiment to verify that this particular problem is isolated to just my setup, I would appreciate it immensely:
- switch the Wiki default timezone to one other than where you are in
- make sure that your user preference indicates your own time zone (i.e., a timezone different than the Wiki default timezone)
- make a forum post and see if the indicated post time matches what you expect
If anybody would be willing to do this, I would be very grateful. Otherwise, I'm kind of stuck here. Of course, I'll point out that it appears that the correct time for my currently-selected timezone is showing up above my posts in this forum, so I might just be the only one with the problem.
|
|
Edited On 7:28:01 AM - Saturday 28th, January 2012 by Lost Student
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 7:56:03 AM - Saturday 28th, January 2012 |
|
Okay, I just had a breakthrough. I first tried replacing the following line in awc/forums/includes/post_phase.php:
$info['date'] = awcsforum_funcs::convert_date($this->p_date, "l") . " " ;
with this:
global $wgLang;
$info['date'] = $wgLang->timeanddate($this->p_date, true, true, $awcUser->timecorrection) . " " ;
(Basically, this switch bypassed the AWC Forum extension function convert_date().) The result was no change--still showing the wrong time on my posts. THEN, I switched the lines for this (note the last parameter passed to timeanddate():
global $wgLang, $wgUser;
$info['date'] = $wgLang->timeanddate($this->p_date, true, true, $wgUser->mOptions['timecorrection']) . " " ;
The result: success! Now, I am getting the right time! So, the bug is somewhere in the way that the variable $awcUser->timecorrection is given value (I think?). I will do a little more investigation to determine what is the problem, then I can go back to using the awcsforum_funcs::convert_date function (I like the nice formatting better).
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 8:22:33 AM - Saturday 28th, January 2012 |
|
| I noticed that there is a class called awcs_forum_user and one called awcUser. Are these supposed to be the same?
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 8:43:31 AM - Saturday 28th, January 2012 |
|
Okay, final post before I'm done for the "night." I went back to forums/includes/funcs.php and replaced the lines:
if(isset($awcUser->timecorrection)){
$user_timeShift = $awcUser->timecorrection;
with these lines:
if(isset($wgUser->mOptions['timecorrection'])){
$user_timeShift = $wgUser->mOptions['timecorrection'];
Then I undid my prior changes to forums/includes/post_phase.php. After a little testing, the timestamp for each post is still correct! I noticed two problems:
- The date format is the short format (abbreviated day and month names--this does not bother me in the least but I would like to know why it is doing it when it should be outputting long format of the date)
- If I sign my name with the four tildas (~), the timestamp shown is the local server time, not my local time. The words Local Time follow the timestamp. This problem is global throughout my wiki--not sure why, but it's unrelated to the forum extension.
Someday I may fix these problems, but I'm just happy to have solved this one.
|
|
|
|
|
|
Gets Around
Wiki Edit 5
Threads 9
Posts 101
|
|
| 12:29:40 PM - Saturday 28th, January 2012 |
|
you've been quite busy on this one. Glad it's partly working for you - at least
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 2:30:34 AM - Sunday 29th, January 2012 |
|
Yeah, having each post's timestamp off by an hour was gnawing at me all week. I told myself last night that I wouldn't go to bed until I fixed it--my last post was posted at 5:30 am my time, so that might tell you how much sleep I got last night.
I realized that the server time is supposed to be displayed with the wiki signature. I just tried it in Wikipedia.org and on that site, a four-tilda signature has a timestamp in UTC time--so I guess that's not a bug.
Anyway, combing through all the coding for this extension really helped me understand how much work has been put into it. I'm very happy to be able to use it in my wiki--thanks!
|
|
|
|
|
|
Gets Around
Wiki Edit 5
Threads 9
Posts 101
|
|
| 6:37:14 AM - Wednesday 01st, February 2012 |
|
AWC who created this extension could probably help you out but noone knows where he is
|
|
|
|
|
|
Clicked A Few Times
Wiki Edit 0
Threads 1
Posts 14
|
|
| 5:47:10 PM - Wednesday 01st, February 2012 |
|
Quote:Dutchman Feb 1st 3:29 amAWC who created this extension could probably help you out but noone knows where he is 
That's too bad that he's MIA. (Not that I would impose on him that he is required to help me or anything--I can see that he has been very generous with his time in creating and sharing this extension.)
I think I will just have to be satisfied with this minor bug for now. I will try to circle back to it in a few weeks when I (hopefully) have the time and motivation to try again.
|
|
|
AWC's:
2.6.0 MediaWiki - Stand Alone Forum Extension Forum theme style by: AWC
|