Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 10:06 pm EDT

Geeklog Forums

Timezone Hack Doesn't Work


Status: offline

BretFarris

Forum User
Newbie
Registered: 10/31/06
Posts: 8
I am using GL 1.4.0sr5, and the timezone hack is there, as was included in the install. I am in the US MST. The time posted on the site's header file says GMT-6, but is actually GMT+6. No matter what I change the timezone to in $_CONF['timezone'] = 'MST5MDT', the header never changes.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
As noted in config.php, the timezone hack is known not to work when safe_mode is on for the PHP install on your webserver. Do you happen to know if that is the case?

bye, Dirk
 Quote

ironmax

Anonymous
Quote by BretFarris: I am using GL 1.4.0sr5, and the timezone hack is there, as was included in the install. I am in the US MST. The time posted on the site's header file says GMT-6, but is actually GMT+6. No matter what I change the timezone to in $_CONF['timezone'] = 'MST5MDT', the header never changes.


Are you sure you want to have your time displayed as GMT+6? That would put you someplace in the Middle East, near Astana, Jayawardenepura. MST would be GMT -0600 hrs.
 Quote

Status: offline

BretFarris

Forum User
Newbie
Registered: 10/31/06
Posts: 8
Quote by Dirk: As noted in config.php, the timezone hack is known not to work when safe_mode is on for the PHP install on your webserver. Do you happen to know if that is the case?


safe_mode is off. Sorry, I should have mentioned that originally.

Quote by ironmax:
Are you sure you want to have your time displayed as GMT+6? That would put you someplace in the Middle East, near Astana, Jayawardenepura. MST would be GMT -0600 hrs.


I do not want GMT+6. I actually want MST, which is now GMT-7. Here is what my page displays right now:
Wednesday, November 01 2006 @ 10:15 PM GMT-6

Right now it is 4:15 PM GMT. So my site displays a time that is 6 hours ahead of GMT, but says it is 6 hours behind GMT. It does this no matter what I make $_CONF['timezone'] equal to. I have tried Eastern Time, I have tried GMT-3, GMT-1, GMT. No matter what I change the timezone to, it always says GMT-6 on the page, and shows the time as six hours in the opposite direction.

Safe mode is OFF on my page. Also, my server displays the current and correct time in MST. Is there anywhere else that the timezone may be set at in the GL files?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by BretFarris: It does this no matter what I make $_CONF['timezone'] equal to. I have tried Eastern Time, I have tried GMT-3, GMT-1, GMT. No matter what I change the timezone to, it always says GMT-6 on the page, and shows the time as six hours in the opposite direction.

Just checking: You did remove the two slashes // from the beginning of that line?

bye, Dirk
 Quote

Status: offline

BretFarris

Forum User
Newbie
Registered: 10/31/06
Posts: 8
Quote by Dirk:
Just checking: You did remove the two slashes // from the beginning of that line?


Yes, I did remove the slashes from the line. I also tried adding them back in, and commented out the hack in the lib_common file to see if it would just use the time from the server. No matter what I do it displays the same behavior.
 Quote

Status: offline

1000ideen

Forum User
Full Member
Registered: 08/04/03
Posts: 1298
I don`t know if I got you right but have you tried exactely this:
$_CONF['timezone'] = 'Etc/GMT+7';
 Quote

Status: offline

Wyoming

Forum User
Junior
Registered: 09/29/06
Posts: 27
I struggled with the same problem and another thread suggested something that put me on the right path. What I came up with is:

$_CONF['timezone'] = 'MST7';

This gives me the correct display in the form of:

Sunday, November 05 2006 @ 10:34 AM MST

I can't explain the whys of it, but it seems to work.
 Quote

Status: offline

BretFarris

Forum User
Newbie
Registered: 10/31/06
Posts: 8
embarrassed
Thanks for all the replies and the suggestions my friends. I have finally gotten it to work, and it turned out to be several things working against me. First, all this happened when my host moved my site to a new computer because the old one failed, and then I had them move me to a dedicated server. So permissions were not set correctly to let me update the config file, though it kept leading me to believe I had.

But the big kicker, and I keep kicking myself for not realizing this much sooner, is that my server has to be set to GMT in the first place. Otherwise it has to be changed to reflect where the server is actually at. I already have my server set to MST, so I just commented out the hack, and it displays my correct timezone. But I wasn't able to find that out until I realized I didn't have the correct permissions on the server.

Just a couple of tiny little problems, which are too easy to overlook sometimes. Thanks again for the suggestions.
 Quote

All times are EDT. The time is now 10:06 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content