Subject: Timezone Hack

Posted on: 17/08/02 06:23am
By: Anonymous

config.php
=======

add line
$_CONF['timezone']  = 'Asia/Kuala_Lumpur';



lib-common.php
==========

add line after
require_once('/path/to/config.php');

if ( !empty($_CONF['timezone']) 
    && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}



This Timezone hack only work when safe_mode is OFF.


Yew Loong
www.edynasys.com
Timezone list (from Squirrelmail)
=====================
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lubumbashi
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Timbuktu
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Adak
America/Anchorage
America/Anguilla
America/Antigua
America/Araguaina
America/Aruba
America/Asuncion
America/Atka
America/Barbados
America/Belem
America/Belize
America/Boa_Vista
America/Bogota
America/Boise
America/Buenos_Aires
America/Cambridge_Bay
America/Cancun
America/Caracas
America/Catamarca
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Cordoba
America/Costa_Rica
America/Cuiaba
America/Curacao
America/Danmarkshavn
America/Dawson
America/Dawson_Creek
America/Denver
America/Detroit
America/Dominica
America/Edmonton
America/Eirunepe
America/El_Salvador
America/Ensenada
America/Fort_Wayne
America/Fortaleza
America/Glace_Bay
America/Godthab
America/Goose_Bay
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Hermosillo
America/Indiana/Indianapolis
America/Indiana/Knox
America/Indiana/Marengo
America/Indiana/Vevay
America/Indianapolis
America/Inuvik
America/Iqaluit
America/Jamaica
America/Jujuy
America/Juneau
America/Kentucky/Louisville
America/Kentucky/Monticello
America/Knox_IN
America/La_Paz
America/Lima
America/Los_Angeles
America/Louisville
America/Maceio
America/Managua
America/Manaus
America/Martinique
America/Mazatlan
America/Mendoza
America/Menominee
America/Merida
America/Mexico_City
America/Miquelon
America/Monterrey
America/Montevideo
America/Montreal
America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha
America/North_Dakota/Center
America/Panama
America/Pangnirtung
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Porto_Acre
America/Porto_Velho
America/Puerto_Rico
America/Rainy_River
America/Rankin_Inlet
America/Recife
America/Regina
America/Rio_Branco
America/Rosario
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/Scoresbysund
America/Shiprock
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Swift_Current
America/Tegucigalpa
America/Thule
America/Thunder_Bay
America/Tijuana
America/Tortola
America/Vancouver
America/Virgin
America/Whitehorse
America/Winnipeg
America/Yakutat
America/Yellowknife
Antarctica/Casey
Antarctica/Davis
Antarctica/DumontDUrville
Antarctica/Mawson
Antarctica/McMurdo
Antarctica/Palmer
Antarctica/South_Pole
Antarctica/Syowa
Antarctica/Vostok
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Ashkhabad
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok

Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Choibalsan
Asia/Chongqing
Asia/Chungking
Asia/Colombo
Asia/Dacca
Asia/Damascus
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Gaza
Asia/Harbin
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Ishigaki
Asia/Istanbul
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kashgar
Asia/Katmandu
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macao
Asia/Macau
Asia/Magadan
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qyzylorda
Asia/Rangoon
Asia/Riyadh
Asia/Riyadh87
Asia/Riyadh88
Asia/Riyadh89
Asia/Saigon
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Tel_Aviv
Asia/Thimbu
Asia/Thimphu
Asia/Tokyo
Asia/Ujung_Pandang
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yekaterinburg
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Canary
Atlantic/Cape_Verde
Atlantic/Faeroe
Atlantic/Jan_Mayen
Atlantic/Madeira
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Canberra
Australia/Darwin
Australia/Hobart
Australia/LHI
Australia/Lindeman
Australia/Lord_Howe
Australia/Melbourne
Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/West
Australia/Yancowinna
Brazil/Acre
Brazil/DeNoronha
Brazil/East
Brazil/West
CET
CST6CDT
Canada/Atlantic
Canada/Central
Canada/East-Saskatchewan
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Pacific
Canada/Saskatchewan
Canada/Yukon
Chile/Continental
Chile/EasterIsland
China/Beijing
China/Shanghai
Cuba
EET
EST
EST5EDT
Egypt
Eire
Etc/GMT
Etc/GMT+0
Etc/GMT+1
Etc/GMT+10
Etc/GMT+11
Etc/GMT+12
Etc/GMT+2
Etc/GMT+3
Etc/GMT+4
Etc/GMT+5
Etc/GMT+6
Etc/GMT+7
Etc/GMT+8
Etc/GMT+9
Etc/GMT-0
Etc/GMT-1
Etc/GMT-10
Etc/GMT-11
Etc/GMT-12
Etc/GMT-13
Etc/GMT-14
Etc/GMT-2
Etc/GMT-3
Etc/GMT-4
Etc/GMT-5
Etc/GMT-6
Etc/GMT-7
Etc/GMT-8
Etc/GMT-9
Etc/GMT0
Etc/Greenwich
Etc/UCT
Etc/UTC
Etc/Universal
Etc/Zulu
Europe/Amsterdam
Europe/Andorra
Europe/Athens
Europe/Belfast
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Helsinki
Europe/Istanbul
Europe/Kaliningrad
Europe/Kiev
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Nicosia
Europe/Oslo
Europe/Paris
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
Europe/San_Marino
Europe/Sarajevo
Europe/Simferopol
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Tirane
Europe/Tiraspol
Europe/Uzhgorod
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Warsaw
Europe/Zagreb
Europe/Zaporozhye
Europe/Zurich
Factory
GB
GB-Eire
GMT
GMT+0
GMT-0
GMT0
Greenwich
HST
Hongkong
Iceland
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Iran
Israel
Jamaica
Japan
Kwajalein
Libya
MET
MST
MST7MDT
Mexico/BajaNorte
Mexico/BajaSur
Mexico/General
Mideast/Riyadh87
Mideast/Riyadh88
Mideast/Riyadh89
NZ
NZ-CHAT
Navajo
PRC
PST8PDT
Pacific/Apia
Pacific/Auckland
Pacific/Chatham
Pacific/Easter
Pacific/Efate
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Galapagos
Pacific/Gambier
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Johnston
Pacific/Kiritimati
Pacific/Kosrae
Pacific/Kwajalein
Pacific/Majuro
Pacific/Marquesas
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Pago_Pago
Pacific/Palau
Pacific/Pitcairn
Pacific/Ponape
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Samoa
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Truk
Pacific/Wake
Pacific/Wallis
Pacific/Yap
Poland
Portugal
ROC
ROK
Singapore
SystemV/AST4
SystemV/AST4ADT
SystemV/CST6
SystemV/CST6CDT
SystemV/EST5
SystemV/EST5EDT
SystemV/HST10
SystemV/MST7
SystemV/MST7MDT
SystemV/PST8
SystemV/PST8PDT
SystemV/YST9
SystemV/YST9YDT
Turkey
UCT
US/Alaska
US/Aleutian
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Indiana-Starke
US/Michigan
US/Mountain
US/Pacific
US/Samoa
UTC
Universal
W-SU
WET
Zulu


Timezone Hack

Posted on: 29/09/02 07:43pm
By: etegration

this hack is what many need but this guy just dont have an example site to show us and he didn't reg, how to contact him? *sigh*

Timezone Hack

Posted on: 23/10/02 11:36pm
By: Anonymous

This hack works great on my Geeklog 1.3.6! Thanks alot!

Timezone Hack

Posted on: 19/11/02 12:05pm
By: Anonymous

This hack works fantastic, thanks very much.. This is really great. Now why can't this be an option in user settings ?????

Timezone Hack

Posted on: 11/12/02 01:02pm
By: Anonymous

How do I tell if I'm in safe mode?

Timezone Hack

Posted on: 02/01/03 10:54am
By: John_Self

Are we going to see a similar hack included in future GL releases? And has anyone confirmed that this hack works with all time-stamped submissions throughout GL? Thanks, John

Timezone Hack

Posted on: 22/01/03 02:45am
By: Anonymous

Well... this does work for display... but when I post a story, it posts it an hour early, which isn't that big of a deal, but it's mildly annoying. FYI I am in CST, and my server is EST. This needs a fix. Hopefully in the next version, or perhaps in another hack.

Timezone Hack - solving the posting problem

Posted on: 12/06/03 10:50am
By: Anonymous

Yeah, I had that problem too, I'm in the UK, but my server is in the USA under EST.

My posts were being moved 5 hours forwards in time after applying the hack - which was both insanely annoying and totally impractical.

After three hours poring over PHP and nearly going insane trying to work out what doing what to which (time stuff is a nightmare) I finally arrived at a very dirty little hack that fixed it.

WARNING:This is a hack-in-progress and is a very nasty cludge - so be warned that this is not (yet) an elegant solution

Here's what I did: Open up story.php (in your admin directory) and search for calls to the function "strtotime()" - there are two calls, one at line 185 and one at line 884. "strtotime" takes a plaintext string, describing a date, and converts it into UNIX time.

OK, so at the end of the string you are going to add a description of you time zone (mine is BST, British Summer Time) and then an offset in hours (i.e the time difference between where your server really is, and where you'd like it to pretend it is).

Confused? Yeah me too, here's an example showing how line 884 looked after I'd hacked it:

$unixdate = strtotime("$publish_month/$publish_day/$publish_year $publish_hour:$publish_minute:$publish_second BST -5 hours");

Let me explain: My timezone is Europe/London - where we are on BST - which is what I want displayed on my site. BST is 5 hours ahead of EST, where my web server lives. You may think that adding both BST and -5 hours is just plain wrong - and you'd be right (I said it was a dirty hack). The point is, it works.

The whole reason for this mess is that the timezone PHP hack only affects PHP - but story.php gets it's dates by asking MySQL what the time is - so GeekLog ends up wiith two conflicting ideas about the time.

One more thing, this hack is likely to go wrong when we move in or out of daylight saving time.

It's all very complex: the GeekLog database dates articles in UNIX time (which is a sort of GMT). Your server works in it's local time, and then you hack your PHP environment to look like it's in yet another time zone. No wonder stuff goes wrong!

Charlie Dancey


Re:Timezone Hack

Posted on: 23/07/03 09:07am
By: destr0yr

soooooo is there any definitive time-hack for GL 1.3.8 ? My www is hosted in EST and i\'m in PST or \"Canada/Pacific\" When i add the following to my lib-common.php i get a lil error...
if ( !empty($_CONF[\'timezone\']) 
&& !ini_get(\"safe_mode\") {
putenv(\"TZ=\".$_CONF[\'timezone\']);
}
The error:
Parse error: parse error in /home/okanagan/public_html/lib-common.php on line 73

Fatal error: Call to undefined function: plg_showcenterblock() in /home/okanagan/public_html/index.php on line 67

Re:Timezone Hack

Posted on: 23/07/03 09:37am
By: Dirk

You\'re missing a closing bracket after the ini_get ... bye, Dirk

Re:Timezone Hack

Posted on: 23/07/03 10:18am
By: DTrumbower

I would move it to lib-custom.php instead of lib-common.php. Won\'t have to change it on next upgrade.

Re:Timezone Hack

Posted on: 23/07/03 03:42pm
By: ola_one

Hello guys, I just saw this thread and I am totally interested. Can you please tell me where in config.php (Anywhere or right after a particular statement or at the bootom) I have to insert the suggested line for timezone, and secondly, am I required to key in all the timezones or just my timezone. May sound stupid but I just want to be sure. In addition, DTrumbower suggested using lib-custom.php instead of lib-common.php for the second entry on the hack. Lastly Dirk, you said the person with the error message was missing a closing bracket after the ini_get, I looked and did not see an opening bracket.. Please correct me if am wrong... I am also running 1.3.8... if ( !empty($_CONF[\'timezone\']) && !ini_get(\"safe_mode\") { putenv(\"TZ=\".$_CONF[\'timezone\']); } Thank you all Ola

Re:Timezone Hack

Posted on: 23/07/03 03:54pm
By: Dirk

Count all the opening brackets in that piece of code. Now count the closing brackets. See? Wink The position of the new variable in config.php shouldn\'t matter. bye, Dirk

Re:Timezone Hack

Posted on: 25/07/03 10:51am
By: DTrumbower

It should look like this.
if ( !empty($_CONF[\'timezone\'])
&& !ini_get(\"safe_mode\")) {
putenv(\"TZ=\".$_CONF[\'timezone\']);
}

Re:Timezone Hack

Posted on: 16/08/03 01:34am
By: josheli

he means parentheses, not bracket.

Re:Timezone Hack

Posted on: 22/11/03 10:29pm
By: Anonymous

I think I found the issue with changing timezones and the story edit not working properly.

On line 910, I changed the DB_save call a little. Instead of storing $date, I changed it to FROM_UNIXTIME($unixdate).

That seemed to solve the issue with having a different time after a story is stored.

Re:Timezone Hack

Posted on: 27/11/03 05:42am
By: geKow

Could you explain that a bit more detailed?
Does that mean replace ...,'$date', with ...,'FROM_UNIXTIME($unixdate)',... ?
(that causes an SQL error)

geKow

Re:Timezone Hack

Posted on: 28/11/03 03:30pm
By: geKow

Ok, I got it (dont use the ') and it seems to work good. Thank you

geKow

Re:Timezone Hack

Posted on: 19/12/03 01:11am
By: Anonymous

I read through this Article
And it seems like a possible solution...can anyone with way more coding experience than me take a look and see if it's something we can all use in our lib-custom.php file? Thanks in advance...

Re:Timezone Hack

Posted on: 19/12/03 03:59am
By: destr0yr

Curious if GL could do something like phpBB and have the GMT's listed for where the server exists and allowing a user to specify which timezone they are in... I guess I could put that in the feature request.

Re:Timezone Hack

Posted on: 28/12/03 02:22am
By: hidden

[QUOTE BY= Joe] I think I found the issue with changing timezones and the story edit not working properly.

On line 910, I changed the DB_save call a little. Instead of storing $date, I changed it to FROM_UNIXTIME($unixdate).

That seemed to solve the issue with having a different time after a story is stored.[/QUOTE]

i guess if should be FROM_UNIXTIME('$unixdate')

Re:Timezone Hack

Posted on: 28/12/03 05:54am
By: geKow

For me it works without any quotes:
,FROM_UNIXTIME($unixdate),


geKow

Timezone Hack

Posted on: 27/01/04 06:23pm
By: Anonymous

I have read through all of these posts. I have my displayed time correct but my story time still doesn't work. When I finally got that to work it made my story's date to be year 1970 and day and time totally wrong. Has there been any more developments in getting the story time to work. If so could you please just do a 're-cap' for me. TIA. The reason the story thing is frustrating is it sets the time a few hours after I wrote it so it doens't display until the time is reached. Thanks.

Timezone Hack

Posted on: 27/01/04 07:10pm
By: geKow

Have you changed your story.php line 910 the way mentioned above?

Mine is:
DB_save($_TABLES['stories'],'sid,uid,tid,title,introtext,bodytext,hits,date,comments,related,featured,commentcode,statuscode,postmode,frontpage,draft_flag,numemails,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,show_topic_icon',"$sid,$uid,'$tid','$title','$introtext','$bodytext',$hits,FROM_UNIXTIME($unixdate),'$comments','$related',$featured,'$commentcode','$statuscode','$postmode','$frontpage',$draft_flag,$numemails,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$show_topic_icon", $return_to);

FROM_UNIXTIME($unixdate) without ANY quotes
geKow

Timezone Hack

Posted on: 27/01/04 08:03pm
By: Anonymous

I have just gone through and chnaged the config and lib-common file to start playing again (I put it all back b4). Now the time is working right (www.myvirtualfaith.com). I have now made the changes to story and am getting a parsing error on this line.

$unixdate = strtotime("$publish_month/$publish_day/$publish_year $publish_hour:$publish_minute:$publish_second" EST -17 hours);

Why is this? have I dont it wrong??

And is this right for the other chnage?

$A['unixdate'] = strtotime($A['publish_year'] . '-' . $A['publish_month'] . '-' . $A['publish_day']
. ' ' . $publish_hour . ':' . $A['publish_minute'] . ':00' . 'EST -17 hours');

Thanks...

Timezone Hack

Posted on: 27/01/04 08:31pm
By: Anonymous

I moved the "" and the error has gone and it all works. Ta, it was the unixtime thing that was the problem. Thanks again.

Timezone Hack

Posted on: 05/02/04 12:03pm
By: pibby

Thanks so much for this info, works great for me

Timezone Hack

Posted on: 18/02/04 01:31pm
By: Anonymous

ok... i read through this and am quite amazed that i actually understood some of it haha... i have the correct time showing (changed the config and lib-common), but as far as the story.php edit... when i do that, all it does is show the current time... so if i post a story, come back in a couple minutes... the posted time is STILL the current time... it just keeps ticking...

any fix for this?

Timezone Hack

Posted on: 03/03/04 03:18am
By: Anonymous

Thanks a lot, these two hacks are great.


Timezone Hack

Posted on: 18/03/04 03:56am
By: Peter_Apockotos

I am not sure if this will help you, but I didn't want to have to hack Geeklog on each update. So I put this in my .htaccess file and now the time reported by geeklog is correct.

SetEnv TZ US/Mountain

If you know of any adverse affects of using this, please let me know.

Timezone Hack

Posted on: 18/03/04 04:31am
By: Peter_Apockotos

Well this did not seem to help new stories posted. Just the date and time shown on the site and the story editor until you submit it.

Any ideas on how to correct this in the DB automatically without hacking the conf?

Timezone Hack

Posted on: 25/04/04 02:30am
By: machinari

this is about the timezone hack and not to do with the story posting time... well, i used this "timezone" hack to no avail on 2 diff sites and neither worked. however, i read a comment in the php manual that suggests some various UNIX servers respond to slightly different formating for the putenv.("TZ=.....);

here is what i did and it finally worked:

$_conf['timezone'] = 'PST8PDT'; //notice the change on this line--added to my config.php after the locale settings

//added to lib-common.php after "require once ..."
if ( !empty($_CONF['timezone'])
&& !ini_get("safe_mode")) {
putenv("TZ=".$_CONF['timezone']);
}

so basically it goes "putenv("TZ=PST8PDT"); (i'm in PDT and server is in CDT ) and all works just great now. before it was spewing time in GMT and the original hack was just changing the time (not correctly) and not the zone. this works now on apache running on freebsd and also works on apache for windows(not that it needs to).

Timezone Hack

Posted on: 05/05/04 09:56am
By: Anonymous

Used both the common-lib and story change and everything is fine @ me.arnists.com thanx for a great hack

Timezone Hack

Posted on: 05/05/04 12:21pm
By: geKow

looking at the read counter, it says that this thread has 3996 hits.
If that ain't a kind of feature request....

geKow

Timezone Hack

Posted on: 14/05/04 08:16pm
By: exdeath

[QUOTE BY= machinari] this is about the timezone hack and not to do with the story posting time... well, i used this "timezone" hack to no avail on 2 diff sites and neither worked. however, i read a comment in the php manual that suggests some various UNIX servers respond to slightly different formating for the putenv.("TZ=.....);

here is what i did and it finally worked:

$_conf['timezone'] = 'PST8PDT'; //notice the change on this line--added to my config.php after the locale settings

//added to lib-common.php after "require once ..."
if ( !empty($_CONF['timezone'])
&& !ini_get("safe_mode")) {
putenv("TZ=".$_CONF['timezone']);
}

so basically it goes "putenv("TZ=PST8PDT"); (i'm in PDT and server is in CDT ) and all works just great now. before it was spewing time in GMT and the original hack was just changing the time (not correctly) and not the zone. this works now on apache running on freebsd and also works on apache for windows(not that it needs to). [/QUOTE]

Where can i find the zone codes for TZ=something
I want my site on Lisbon time.

Timezone Hack

Posted on: 14/05/04 08:27pm
By: geKow

The verry first posting of this thread includes a quite huge list of timezones in the 3rd code field.

geKow

Timezone Hack

Posted on: 31/05/04 11:59am
By: hjklassen

I am running GL 1.3.9. I have tried and tried this hack, but it seems to make no difference whatsoever. My host informs me that safe mode is off. I am tearing my hair out! Do I need to indent the $_conf['timezone'] = 'PST8PDT'; 4 spaces? I tried both ways, and nothing seems to make a difference. Anything new on this front?

Thx,
Hans

Timezone Hack

Posted on: 19/06/04 08:40am
By: trenchteam

Please let me know when a stable hack for this is done for 1.3.9 That would help. Im a day ahead of my server, so the time is really off badly.

Timezone Hack

Posted on: 19/06/04 11:36am
By: hjklassen

I have actually used the above hack (had to change $_conf to $_CONF) for 6 sites, and it works like a hot damn. The only minor issue I have noticed is the story posting time is off by a few hours. Otherwise, I am totally happy with it.

Thanks!

Hans

Timezone Hack

Posted on: 19/06/04 10:31pm
By: Anonymous

I think I have read over every single post on this website dealing with timezones at least 10 times. Ive tried the hack a zillion times and a zillion ways--it just wont work. I've even left Geeklog completely several times but keep coming back becasue of a couple of the features I need (like the VERY nice built-in calendar system). But my server is in Japan and I am in Iowa. My website goes along with high school classes that I teach. I decided that I really dont need a pinpoint date and time and I was tired of screwing with it so here is what I did:

$_CONF['language']  = 'english';
$_CONF['locale']    = 'en-gb';
$_CONF['date']      = '%B %Y';
$_CONF['daytime']   = '%B %Y';
$_CONF['shortdate'] = '%B %Y';
$_CONF['dateonly']  = '%B %Y';
$_CONF['timeonly']  = '%B %Y';
$_CONF['default_charset'] = 'iso-8859-1';


Wala! Take that you bastard Geeklog!

So whenever there is a date or time it just shows up as the month and year and thats just fine for what I need it for. In posting stories it works just fine and deep down Geeklog still knows what day it is--the highlighted calendar day is still going along with Japan time. But for what I need it for, its an acceptable compromise.

Matt

Timezone Hack

Posted on: 26/06/04 12:26am
By: Anonymous

I tried to install this timezone thing and it didn't work...seemed to be a path error.

I deleted the hack code references and reloaded my config.php and lib-common.php

OUCH

Now my website doesn't work

HELP

How do I fix this?

Warning: main(classes/timer.class.php): failed to open stream: No such file or directory in /www/j/jollymoon/htdocs/aande/lib-common.php on line 113

Fatal error: main(): Failed opening required 'classes/timer.class.php' (include_path='.:/usr/local/lib/php') in /www/j/jollymoon/htdocs/aande/lib-common.php on line 113

Timezone Hack

Posted on: 26/06/04 07:54am
By: Anonymous


Oh Well...

Someone failed to mention that when you insert the TimeZone Hack references into the required config.php and lib-common.php that they didn't say where EXACTLY...

When I deleted those references to restore my working website, it wouldn't come back UNTIL I went line by line in these two files and put each line into its original position EXACTLY. And voila! Now my site works again. WHEW!

What a hassle and several hours down time.

So where Exactly do you put the two commands in these files in order for the time zone thing to work???

I won't try another HACK again without explicit instructions and verbose help...



Timezone Hack

Posted on: 26/06/04 08:16am
By: trenchteam

^^thats why I haven't touched this hack, until its packaged and ready to go!

Timezone Hack

Posted on: 26/06/04 08:38am
By: geKow

Sorry, but I really don't see a problem with that ...

ok, config.php:
$_CONF['timezone'] = 'Yourtimezone';
I think it doesn't matter so much where you put that line, I have it behind $_CONF['path_html'] (in the next line)

the lib-common.php part is perfectly described in the initial post of this thread.
add line after
require_once('/path/to/config.php');


the last one is here: public_html/admin/story.php
look for a line that starts with:
DB_save($_TABLES['stories']'
and replace
,'$date',
with ...
,FROM_UNIXTIME($unixdate),
(no inverted comma!)

Good luck

geKow

btw. I would be interested to know what you have done wrong when you tried to remove the "hack"

Timezone Hack

Posted on: 26/06/04 09:19am
By: exdeath

For those who use this hack and still get a wrong time, try using Etc/GMT+X on the timezone, where the X is any number of hours. Just play around with X until you get the correct time, for instance, I had to use Etc/GMT-29 (i was a day and a few hours off) on my site to get the right time.

Timezone Hack

Posted on: 23/07/04 04:24pm
By: thedude

Works great for me. Not sure whether this matter or not but I'm using Linux for the OS. Anyway, not trying to rub it in, but this is like the easiest hack I have ever done. If you read the instruction carefully though.


Excellent work Yew Loong.


Many thanks.

The Dude

Timezone Hack

Posted on: 07/09/04 06:09pm
By: Anonymous

I had to use the timezone as EST - 25 hours but it worked for me in the end. It defaults to jan 1 1970 if you don't have the correct letters, e.g. I tried AEST as the letter code, but PHP doesn't recognise australian eastern standard time.

Timezone Hack

Posted on: 09/09/04 09:49am
By: tobymiller

All I had to do was edit two files:

1) config.php

Add this line (line 224):
$_CONF['timezone']  = 'US/Eastern';


after this line (line 223):
$_CONF['default_charset'] = 'iso-8859-1';


2) lib-custom.php

Add these lines (line 45):
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}


after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.

Timezone Hack

Posted on: 12/09/04 02:15am
By: Anonymous

Yeah - this almost works in 1.3.9, however stories are posted with a time one hour behind the actual time. UG!

Perhaps we could encourage the author of GeekLog to put a system wide fix in the next release.

I'm sure many Gl site admins would be very thankful.

It's not a big deal until someone complains about it to us and we don't have a solution ready.

But hey, it's better than nothing at all. I'm happy with the hack or non at all for that matter. GeekLog is making my job easier than ever. Thanks man!

Timezone Hack

Posted on: 19/09/04 02:45am
By: thebiss

My server's in Arizona (godaddy.com,) but we're in Connecticut, and having the same timezone problems. I found that the initial timezone hack (first post) didn't work until I made the following changes:

(0) Add the timezone hack to lib-common.php

(1) Modify locale in config.php, changing to US English:

// $_CONF['locale'] = 'en-gb';
$_CONF['locale'] = 'en-us';

(2) Add the timezone setting to config.php, below the existing locale settings, and assigning it the value EST5EDT. The "America/New_York" settings had no effect!

// $_CONF['timezone'] = 'America/New_York'; // no luck
// $_CONF['timezone'] = ':America/New_York'; // no luck
$_CONF['timezone'] = 'EST5EDT'; // success!


Good luck.
-- Brian

Timezone Hack

Posted on: 22/09/04 11:42pm
By: Anonymous

Hey anyone know the TZ for Austraila, Melbourne

Timezone Hack

Posted on: 05/10/04 01:53am
By: jonc

just did the hack, just like it was originally posted and it worked great - running 1.3.9sr1 BTW.

Also did the admin/story.php line change on #910 and again worked great.

My , this would be great for a system setting.

Thanks for the hack though.

Timezone Hack

Posted on: 27/10/04 04:20pm
By: Anonymous

[QUOTE BY= tobymiller] All I had to do was edit two files:

1) config.php

Add this line (line 224):
$_CONF['timezone']  = 'US/Eastern';



after this line (line 223):
$_CONF['default_charset'] = 'iso-8859-1';



2) lib-custom.php

Add these lines (line 45):
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}



after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.[/QUOTE]

lib-custom.php --- is this a new file w/ GL 1.3.9sr1 -- I think I'm running 1.3.9, but I don't see the file anywhere..

Did you mean lib-common.php ??

thanks again!

Timezone Hack

Posted on: 27/10/04 04:52pm
By: zipstart

lib_custom is in your geeklog/system dir.

Timezone Hack

Posted on: 27/10/04 05:59pm
By: Anonymous

[QUOTE BY= tobymiller] All I had to do was edit two files:

1) config.php

Add this line (line 224):
$_CONF['timezone']  = 'US/Eastern';



after this line (line 223):
$_CONF['default_charset'] = 'iso-8859-1';



2) lib-custom.php

Add these lines (line 45):
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}



after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.[/QUOTE]

I made the changes suggested above -- (except I made changes to lib-common.php instead of lib-custom.php (didn't see a lib-custom.php w/ 1.3.9))

The timezone changes to the correct one I specified, but when I try to log in as an admin via /admin

I get these errors:

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxxx/lib-common.php:531 in /home/jserra/public_html/lions/system/lib-sessions.php on line 314

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxxx/lib-common.php:531 in /home/jserra/public_html/lions/admin/auth.inc.php on line 73

To be more explicit, I am able to load the admin login page with no errors, but when I type in the login information and click Submit, I get a two second error flash at the top of the page (the real page does load below the errors - and I see that for a second I'm logged in (cause I see the Logout button for a split second)) but after the two seconds it redirects me again to the moderation.php admin login page..

Anybody having the similar issue?

Thanks!

BTW - normally these errors mean extra empty lines at the bottom of the pages??

There are no empty lines at the bottom of the two pages noted in the error message - also I checked moderation.php, etc., but still I receive the error...

Timezone Hack

Posted on: 27/10/04 06:12pm
By: Anonymous

[QUOTE BY= zipstart] lib_custom is in your geeklog/system dir.[/QUOTE]

My bad - yes, thanks to tobymiller for the hack - and to zipstart for
correcting my error (I was adding the line to the lib-common.php instead
of the lib-custom.php (which is in the /system folder)

Thanks again to all for creating a good discussion and hacks for this
important issue.


Timezone Hack

Posted on: 27/10/04 07:00pm
By: machinari


fyi this "hack" has made it to the core in the 1.3.10rc's.

Timezone Hack

Posted on: 28/10/04 02:47am
By: MrHyde

[QUOTE BY= Jody] Hey anyone know the TZ for Austraila, Melbourne[/QUOTE]

Try Australia/Melbourne.

Other options could be UTC + 10 (not sure if that takes Daylight Savings into account) or AEST (Australian Eastern Standard Time).

Timezone Hack

Posted on: 11/11/04 11:50am
By: Sticks



I've recently installed geeklog onto my site. I made the timezone hack to the config files for GL to show Aust. Eastern Daylight Time for my posted stories, etc.. and that all worked well.

I'm NOW informed that since I installed geeklog, that the apache server has been logging lines with altered timezones!?!

The server resides in the US (-0600), my site is for Melbourne (+1100 currently) and the time the apache log troubles started co-incide with me 'hacking' GL for the timezone fix.

An example was sent to me:

xx.xxx.xxx.x - - [11/Nov/2004:09:59:13 -0600] "GET /newmenu_shop.gif
HTTP/1.1" 200 2301
xx.xxx.xxx.x - - [11/Nov/2004:09:59:13 -0600] "GET
/spotlight_bottom.jpg HTTP/1.1" 200 2754
xx.xxx.xxx.x - - [11/Nov/2004:09:59:14 -0600] "GET
/d3_contenttile.gif HTTP/1.1" 200 850
xx.xxx.xxx.x - - [11/Nov/2004:09:59:14 -0600] "GET /d3_content.gif
HTTP/1.1" 200 2028
xx.xxx.xxx.x - - [12/Nov/2004:02:59:13 +1100] "GET
/spotlight_codfhpreview.jpg HTTP/1.1" 200 24222
xx.xxx.xxx.x - - [11/Nov/2004:09:59:15 -0600] "GET
/scorecard_title.gif HTTP/1.1" 200 2398
xx.xxx.xxx.x - - [12/Nov/2004:02:59:15 +1100] "GET /boxart/413.jpg
HTTP/1.1" 200 9767
xx.xxx.xxx.x - - [11/Nov/2004:09:59:15 -0600] "GET
/scorecard_Computer.gif HTTP/1.1" 200 8853


Now - I can't for the life of me understand how one site can have a server wide impact. This logging issue is effecting every site being run on this server (20+ websites!)

I'm currently running Geeklog 1.3.10rc2.


Timezone Hack

Posted on: 11/11/04 12:01pm
By: Sticks

Just as an update to this - I've removed the timezone hack [ie; commented it out] and the logs are logging normally again.

It would seem this is definately the cause of the trouble,

Timezone Hack

Posted on: 12/11/04 02:19am
By: Sticks

Further investigation found this bug report for apache and PHP which is very relevant to this timezone hack.

config.php uses:

$_CONF['timezone'] = 'Australia/Melbourne';


lib-common.php uses:

if( !empty( $_CONF['timezone'] ) && !ini_get( 'safe_mode' ) &&
function_exists( 'putenv' )) {
putenv( 'TZ=' . $_CONF['timezone'] );
}


The bugzilla report states:

Remember that the TZ variable is global to the process. If a mod_perl
or PHP script sets that variable, it will I think affect logs written
out by Apache in the future.


Maybe telling Geeklog to use TZ as it's variable isn't a smart thing to do given it's frelling up logging!?!!

Timezone Hack

Posted on: 21/03/05 04:11am
By: Anonymous

[QUOTE BY= Anonymous] How do I tell if I'm in safe mode?[/QUOTE]

I can't find the "safe mode=on" location Please help!

Timezone Hack

Posted on: 03/04/05 06:56am
By: Anonymous

It worked with{timezone} = PST8PDT! Thanks everyone!

Check out our site: renoimc.org

Timezone Hack

Posted on: 07/05/05 06:06pm
By: Anonymous

How do I know if I'm in safe mode?

Timezone Hack

Posted on: 07/05/05 09:12pm
By: r_f_o_t

[QUOTE BY= six mix] How do I know if I'm in safe mode? [/QUOTE]
Create a file named something like info.php with this in it.
<?php phpinfo(); ?>

Upload it to your server and call it with your browser. (Like http://www.example.com/info.php) That will give you all kinds of info, including if safe mode is on or off.

HTH,

Chuck

Timezone Hack

Posted on: 13/05/05 06:14pm
By: b.raven

Mine works now just 15min SLOW but closer than it was! thanks!

Timezone Hack

Posted on: 16/05/05 01:13am
By: Porkchop

Awesome... I can confirm this works just as originally posted on GL 1.3.11

-Porkchop
www.squalidlittlehobo.com

Timezone Hack

Posted on: 25/05/05 08:59pm
By: nightshadow

I applied the timezone hack, both parts as per page 1 and set it to EST -25hrs with australia/brisbane.
it works perfectly fine on the site and date / time is displayed correctly.
My syndicated feed on livejournal displays the wrong time date etc (~14 hrs off).
any ideas on how to overcome this?
my timezone is GMT+10, the server resides in netherlands i think.

Timezone Hack

Posted on: 06/06/05 07:21pm
By: Anonymous

Works perfectly! And exactly what I was looking for

Timezone Hack

Posted on: 25/07/05 03:21am
By: IanKorman

This hack is awesome. Just what I was looking for!! You rock Sticks!!

Timezone Hack

Posted on: 07/08/05 11:49am
By: Anonymous

Worked perfectly for me, THankyou
Make sure you don't ever use cpanel's text editor

Timezone Hack

Posted on: 02/12/05 11:14pm
By: Anonymous

This was a great hack. It worked for me.

Thanks to the person who came up with it and I'd also like to take the opportunity to thank the great guys who came up with Geeklog in the first place.

Timezone Hack

Posted on: 10/02/06 10:25pm
By: geekmom

[QUOTE BY= tobymiller] That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.[/QUOTE]

This worked like a charm. I had a prompt to put the hack on the config.php page, but placed it below the prompt and went nuts trying to figure out why it didn't work.

Toby's clear cut instructions did the trick!

Thanks

Timezone Hack

Posted on: 20/03/06 10:58pm
By: Anonymous

[QUOTE BY= Joe] I think I found the issue with changing timezones and the story edit not working properly.

On line 910, I changed the DB_save call a little. Instead of storing $date, I changed it to FROM_UNIXTIME($unixdate).

That seemed to solve the issue with having a different time after a story is stored.[/QUOTE]

I actually found that the reason this works, because loggically it shouldn't as you're theoretically still using the same date. However you are not, some code above this actually changes $unixdate and updates it to the current value returned by time()

        $date = date("Y-m-d H:i:s",$unixdate); #### here $date is set from $unixdate

        if (empty($hits)) {
            $hits = 0;
        }

        // Get draft flag value
        if ($draft_flag == 'on') {
            $draft_flag = 1;
        } else {
            $draft_flag = 0;

            // OK, if this story was already in the database and the user
            // changed this from a draft to an actual story then update the
            // date to be now
            if (DB_count($_TABLES['stories'],'sid',$sid) == 1) {
                if (DB_getItem($_TABLES['stories'],'draft_flag',"sid = '$sid'") == 1) {
                    $unixdate = time(); #### here it is changed
                }
            }
        }


so a better fix is to move the assignment to $date below this code block, in theory anyway. I haven't fully tested this out yet.

Timezone Hack

Posted on: 20/03/06 11:02pm
By: Anonymous

[QUOTE BY= Sticks]
Maybe telling Geeklog to use TZ as it's variable isn't a smart thing to do given it's frelling up logging!?!!
[/QUOTE]

one option is to try this:
if( !empty( $_CONF['timezone'] ) && !ini_get( "safe_mode" ) ) {
	register_shutdown_function( create_function( '$tz', 'putenv( "TZ=".$tz );' ), getenv( "TZ" ) );
	putenv( "TZ=" . $_CONF['timezone'] );
}


Timezone Hack

Posted on: 04/11/06 10:24am
By: Anonymous

Parse error: syntax error, unexpected T_DEC, expecting T_VARIABLE or '$' in /home/eighty/public_html/portal/config.php on line 287

How do I fixed this error?

Thanks

Timezone Hack

Posted on: 13/11/06 04:18am
By: Anonymous

Hi,

I was also following the instructions to change the time zone, but i got the following errors:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/o/r/morelook/html/geeklog/config.php:1753) in /home/content/m/o/r/morelook/html/geeklog/system/lib-sessions.php on line 311

Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/o/r/morelook/html/geeklog/config.php:1753) in /home/content/m/o/r/morelook/html/geeklog/public_html/lib-common.php on line 811

May I ask why this happens, and how I can resolve the issues, as I urgently need to change the timezone?

Thanks.

Timezone Hack

Posted on: 13/11/06 07:13am
By: jmucchiello

[QUOTE BY= Wealthykitty]Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/o/r/morelook/html/geeklog/config.php:1753) in /home/content/m/o/r/morelook/html/geeklog/system/lib-sessions.php on line 311
[/QUOTE]What's on line 1753 of config.php? I'm guessing you have extra spaces or line break after the ?> tag. Check the FAQ: Cannot modify header information - headers already sent by ...

Re: Timezone Hack

Posted on: 06/02/07 10:23am
By: Anonymous

I had a slightly different problem to most here, though related!

As I'm in the UK, display of time should be in GMT. So I used the two hacks given at the start of this thread (the timezone in config.php and the hack to lib-common). This gave me corrected time display in the browser - well, almost - it still does not show the AM/PM, but that is another story - and also gave correct timestamp to saved stories in the database.

For some reason, though - perhaps becuase my ISP is only running php 4.4.4, and not 5 - these hacks made no difference to my other problem. The NOW() used by MySQL in the database queries is still on Mountain Time, but the data is GMT! So any new stories I put up do not appear for six hours, unless I hack the story and back up the saved time.

This change to my \system\databases\mysql.class.php file - as the top lines within the function dbQuery(). Mine now reads (around line 254):

function dbQuery($sql,$ignore_errors=0)
{
$tempsql = str_replace('NOW()',"'". gmdate('Y-m-d H:i:s', time()) . "'", $sql);
$sql = $tempsql; ........

Once that had been uploaded, any story I post is now immediately available.

There are probably drawbacks elsewhere from this hack, but I noted that the MSSQL class had some replacement texts for NOW(), so I though that this one might just work; and it did. (There is probably also a simpler way to do this code, but I couldn't think of one.)

Hope this helps someone else, though I don't know what you do if you aren't on GMT.
:banana:

Re: Timezone Hack

Posted on: 22/10/07 02:55am
By: Anonymous

I've tried following these instructions but i'm having no luck... this is a PITA!

Can someone please explain how I change the timezone?

I am using Geeklog 1.4

Re: Timezone Hack

Posted on: 22/10/07 03:22am
By: Dirk

This hack has been rolled into the Geeklog core code for a while now. You only need to set $_CONF['timezone‘] in your config.php

bye, Dirk

Re: Timezone Hack

Posted on: 22/10/07 03:25pm
By: Anonymous

Well thanks for your prompt reply. If this is the case, then I wish someone would keep the code comment up-to-date, because just above the timezone code there is the following text:

// "Timezone Hack"
// If your webserver is located in a different timezone than yourself but you
// prefer Geeklog to post stories in your local time, then set your local
// timezone here.
//
// Please note that this does not work when safe_mode is on!
//
// For more information, see this discussion on geeklog.net:
// http://www.geeklog.net/forum/viewtopic.php?showtopic=21232


Which obviously directs me to this thread.

Anyway, i've tried changing the timezone to GMT, but without any luck. Do you mind telling me how to change it to UK time?

Any help appreciated.. Thankyou.

Re: Timezone Hack

Posted on: 22/10/07 03:26pm
By: Anonymous

ok, I see where i've been going wrong.. I needed to uncomment the line! Sorry, done and now working. Cheers.

Re: Timezone Hack

Posted on: 24/10/07 01:25am
By: scarecrow

Quote by: Dirk

This hack has been rolled into the Geeklog core code for a while now. You only need to set $_CONF['timezone‘] in your config.php



I've come across another anomaly that I'm pretty sure is more of a server problem than a GL issue. The remote server is in EST/EDT, and I'm in CST/CDT. While the setting the 'timezone' variable does work to correct the zone, the time is always displayed without AM or PM. That is, if a message is posted at 15:30 in the afternoon, it displays '03:30 CDT'. This is true whether I set 'timezone' or let it ride as Eastern time, thus my suspicion that it's something with the server. I'd love to have all times displayed as 'military' (24 hour clock) Central time, but even knowing whether it was AM or PM would probably suffice. Any thoughts on how I might achieve either of the above? Thanks in advance!

Re: Timezone Hack

Posted on: 24/10/07 05:37am
By: 1000ideen

There is a forum search button... Confused
http://www.geeklog.net/forum/viewtopic.php?showtopic=78581

As far as I can see these php timezones work. :kickcan:

Re: Timezone Hack

Posted on: 25/10/07 10:02pm
By: scarecrow

the time is always displayed without AM or PM. That is, if a message is posted at 15:30 in the afternoon, it displays '03:30 CDT'...

displayed as 'military' (24 hour clock) Central time


Well, as I suspected, things were a bit odd at the server. After a fairly long phone conversation with the hosting company, the tech found where there had been several time and time zone issues on a RedHat server on which the site in question lived. A sister server running Debian didn't have these issues. It required 90 minutes of downtime, but they transfered the entire account to the Debian box, and BINGO! Not only does AM/PM now show up, the 12/24 config setting works to show 'military' time if set to '24' and actually shows the correct hours between 13 and 23. Praise the Lord and pass the Zantac!

'crow

Re: Timezone Hack

Posted on: 23/11/07 01:04pm
By: rdunne

worked for me in ireland using etc/gmt.
thanks
rich

Re: Timezone Hack

Posted on: 12/11/08 09:39am
By: Anonymous

Most of these hacks work, but the simple one is in the config.php file. The problem for me (for days) :banghead: :banghead: was safe mode. Before you go any further call your provider and ask to have safemode shut off. Then all is well with the simple fix. Big Grin

Re: Timezone Hack

Posted on: 10/03/09 09:22am
By: Anonymous

I have read the timezone hack post, but think this deserves it's own topic so it can be found specifically for the change to daylight savings time. I have two sites working great. Then Daylight savings time comes and my dates are showing Tuesday, "March 10 2009 @ 01:016 PM UTC" at 8:16 AM. Below is my timezone hack in config php. I tried adjusting it a number of ways and no luck. I get KRAT and several other unexpected time zones. I am in the US CST now Daylight saving time I think CDT is the abbreviation. I am sure this is a problem for others.

$_CONF['timezone'] = 'CST/GMT-6';

Re: Timezone Hack

Posted on: 13/09/10 09:21am
By: gtgillis

I tried the GL config timezone setting but it would not work. I then tried the SetEnv TZ America/Chicago in my .htaccess file but that did not work either.

Running Geeklog 1.7.0 on PHP 5.2.13 I just added the following to my lib-custom.php file.

PHP Formatted Code

date_default_timezone_set('America/Chicago');
 

Re: Timezone Hack

Posted on: 13/09/10 09:27am
By: Dirk

Quote by: gtgillis

I tried the GL config timezone setting but it would not work.


Please note that there are two timezone settings now (since 1.6.1): A global one in the Configuration and a per-user setting under My Account.

For details, see http://wiki.geeklog.net/index.php/Timezone_Support

bye, Dirk

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=21232