elurnet
11-05-11, 07:48 PM
Hi,
I have a Dotproject installation on a shared server in US, but I live in Spain then the time of all features is wrong.
I'm trying to fix by changing the code, but can not. I have read around the forum and I have tried this:
- Insert putenv('TZ=Europe/Madrid'); function in date.class.php file. Only works in the forums and files sections.
I have looked here:
http://forums.dotproject.net/showthread.php?t=754&page=2
- I have also tried adding a new function in date.class.php in the "class CDate extends Date":
public function __construct($date=null)
{
$this->tz = Date_TimeZone::getDefault();
if (is_null($date)) {
$this->setDate(date("Y-m-d H:i:s"));
} elseif (is_a($date, 'Date')) {
$this->copy($date);
} else {
$this->setDate($date);
}
$offset = 9; // How man hours different are you? (always positive)
// If your clock is ahead of the server, uncomment this line:
$this->addSeconds(60*60*$offset);
// If your clock is behind of the server, uncomment this line:
// $this->subtractSeconds(60*60*$offset);
}
This work! But it has a serious problem... In the calendar doesn't work month's next and previous buttons, neither years. This is because it always only points today.
I have looked here:
http://discussion.dreamhost.com/thread-97047.html
I need help please!
Thanks!
I have a Dotproject installation on a shared server in US, but I live in Spain then the time of all features is wrong.
I'm trying to fix by changing the code, but can not. I have read around the forum and I have tried this:
- Insert putenv('TZ=Europe/Madrid'); function in date.class.php file. Only works in the forums and files sections.
I have looked here:
http://forums.dotproject.net/showthread.php?t=754&page=2
- I have also tried adding a new function in date.class.php in the "class CDate extends Date":
public function __construct($date=null)
{
$this->tz = Date_TimeZone::getDefault();
if (is_null($date)) {
$this->setDate(date("Y-m-d H:i:s"));
} elseif (is_a($date, 'Date')) {
$this->copy($date);
} else {
$this->setDate($date);
}
$offset = 9; // How man hours different are you? (always positive)
// If your clock is ahead of the server, uncomment this line:
$this->addSeconds(60*60*$offset);
// If your clock is behind of the server, uncomment this line:
// $this->subtractSeconds(60*60*$offset);
}
This work! But it has a serious problem... In the calendar doesn't work month's next and previous buttons, neither years. This is because it always only points today.
I have looked here:
http://discussion.dreamhost.com/thread-97047.html
I need help please!
Thanks!