i am looking to add six hours to the time shown on news articles. i have managed to change the timezone courtesy of a search through these forums, but can't seem to find where to add hours/minutes onto the server time.
i think this is the part of the mainfile.php i need to change
Code:
// Beta 3 code by Quake 08/19/2005
// Written for Nuke-Evolution and Nuke Patched
function formatTimestamp($time) {
global $datetime, $locale;
setlocale(LC_TIME, $locale);
if (!is_numeric($time)) {
preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/', $time, $datetime);
$time = gmmktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]);
}
$time -= date("Z");
$datetime = strftime(_DATESTRING, $time);
$datetime = ucfirst($datetime);
return $datetime;
}
the original fix might relate to the original phpnuke, but not after the various patches that raven et al have applied.
it's no big thing anyway. it's just that after being able to change the timezone to something more at home (i live in gmt-land, the server is in cst-land) it would have been nice to have the time i posted a story reflected with the timestamp.
i was just thinking that if a "fix" was found, then it would be great for anybody who really needs to have an acurate timestamp.
the quote containing the code is lifted directly from the faq about changing the timestamp.
the code under "i think this is the part of the mainfile.php i need to change" is what i think i have to change in my mainfile.php, but i have no idea what to change in it. i've tried a few things, but i think the "gmmktime" must mean someting different in php to "strftime" and knocks the fix for whack.
well strftime is a stringformat that works with local and gmmktime gets a unix timestamp.
maybe if you search on php.net it might help a bit..
i tried a few edits on my testsite but end up with the same time.
Remember that your user time is defined on your profile. Unless you change the time stored in the database for when the article was written, the time for a story is relative to your user profile time.
If it's just the news articles you want to change, I'd suggest looking into the news admin function for approving and creating stories and add 6 hours (in seconds) before updating or inserting.
found it! i knew it was a matter of adding either the difference in minutes or hours somewhere in the mainfile.php, but was unable to find anywhere that said how/where to do it to the nuke-evolution/nuke patched mainfile.php
after failed searching on a number of my fave nuke forums, i found the answer here (
Only registered users can see links on this board! Get registered or login to the forums!
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum