Cannot change board time no matter what I do.

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Cannot change board time no matter what I do.

Post by AsciiSector »

I'm running a 2.0.22 board at http://www.asciisector.net/forum (yes, I know I need to update). For a long time I've been trying to get the time to be displayed properly. I understand that there's both a general board time zone (set in the Admin Panel) and a user time zone (set in the user's profile). However, trying to change either of these have absolutely no effect. The time zone in the Admin Panel is set to GMT+2 (daylight savings time in Denmark). I've got the same in my admin user profile. However, the time displayed on my board is always 2 hours behind my actual local time here in Denmark. I've tried to change the time in my admin profile to other time zones, but there's no change. I've also tried creating a new test user and setting the time in that profile. Again, no change. I've changed the time in the Admin Panel. No change - all times are still 2 hours behind. I've logged into my cPanel and checked the time in there (to check that the server time is correct) and that time is correct. What to do? I can't understand why all of my fooling around with changing the time zone setting in the Admin Panel and/or the user profile doesn't have any noticable effect...

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51980
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Cannot change board time no matter what I do.

Post by Brf »

Did you checkmark Daylight Saving time? That would account for one hour. The other hour is caused by your server having the wrong time.

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

There's a Daylight Savings time function in 2.0.22? Also, the time is correct in my cPanel, so I gather my server's time is correct.

What's frustrating to me is that no matter what changes I make, the time is always the same on my board. Is this a cookie issue?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51980
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Cannot change board time no matter what I do.

Post by Brf »

AsciiSector wrote: the time is correct in my cPanel, so I gather my server's time is correct.
Does your cpanel also display the timezone? It could be displaying the correct time in the wrong zone.

The time on your board cannot possibly be showing the same time if you change your timezone in your profile. Try changing your profile to Australia time and see what happens.

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

I just tried setting the time zone in my profile to GMT-10 and no change. My "last visit time" is 3:38 PM" when it should be 5:38 PM and all message times are also still displayed as two hours off.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51191
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Cannot change board time no matter what I do.

Post by stevemaury »

Try a new post and see if the post time is correct. It may be that the server time is off and you will have to use a different offset to compensate.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

Okay, my profile time zone is now set to GMT-12 for the posting test. I made a new post and the time on the post was "3:39 PM" -- still two hours behind the correct time. So, changing my profile time zone still has no effect...

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51980
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Cannot change board time no matter what I do.

Post by Brf »

You must have something wrong if your profile timezone is not changing the displayed time. It looks like everything is being displayed in GMT

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

Yeah, I don't have a clue as to what's wrong, though... :(

User avatar
Lumpy Burgertushie
Registered User
Posts: 67379
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cannot change board time no matter what I do.

Post by Lumpy Burgertushie »

please provide a test account so we can test.

thanks,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

Account: test
Password: test

Please post testing posts in the "Time testing" topic under "Everything else". Thanks!

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

Woohoo! I got it working.

The error was in the "Today and Yesterday Hack" mod from phpbbhacks.com. This hack has this change:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------ 
#
	return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

# 
#-----[ REPLACE WITH ]-----------------------------------
#

// friendly date mod\\*******************

	$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
	
	$L_Today = 'Today';
	$L_Yesterday = 'Yesterday';
	$time_format = " - h:i a";// - hour:minute am/pm
	
	$date = getdate();
	$today = $date['mday'];
	$month = $date['mon'];
	$year = $date['year'];

	$forum_date_today = @gmdate ("d", $gmepoch);
	$forum_date_month = @gmdate ("m", $gmepoch);
	$forum_date_year = @gmdate ("Y", $gmepoch);
	
	if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
		$thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today
	
	else
	if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
		$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
		
	else
	//if today is 1 and the month is not 1, then we have to check how many days in the previews month
	//and then set $yesterday to the last day in the previews month
	if ($today == 1 && $month != 1)
	{
	$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
	if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
		$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
	}
	else 
	//if we are in the first day in the year
	if ($today == 1 && $month == 1)
	{
	$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
	if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
		$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
	}

   	return ($thetime);
//end friendly date \\*******************************

# 
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
There are four places in this replacement code were it says $gmepoch when it should say $gmepoch + (3600 * $tz), so I just fixed that.

User avatar
Lumpy Burgertushie
Registered User
Posts: 67379
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cannot change board time no matter what I do.

Post by Lumpy Burgertushie »

ok, I tested . I set the time in the profile for the user "test" to what my time is here in Texas,


I posted. It was exactly right according to my computer clock.

That means that your server clock is correct and that the board is working correctly.

That also means that you are not doing something correct when you change the settings.

once again, just to be sure;

1. in the admin panel, the time settings only apply if you are logged out and as the default setting for new members.

2. once registered and logged in, you go to your profile and change the settings to whatever you like.

this applies to every member, including the admins/owners etc.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Cannot change board time no matter what I do.

Post by AsciiSector »

I figured out what the problem was and fixed it just seconds before you did your test. :)

BiboBB
Registered User
Posts: 106
Joined: Thu Dec 13, 2007 7:34 pm

Re: Cannot change board time no matter what I do.

Post by BiboBB »

actually the problem IS from today, yesterday mod.. TY all :D

Locked

Return to “2.0.x Support Forum”