TimeZone in dotProject

apps

#1

Hi,

I have just signed up with DreamHost and am getting to learn/love dotProject for our project management app.

My timezone is Asia/Calcutta whereas dotProject takes the server time as default. I need to set the correct timezone for my installation.

A few steps I took (with varying degrees of success):

  1. Setting up a .htaccess file in the root folder with the following line
    SetEnv TZ Asia/Calcutta
    Result - no effect.

  2. Inserting the line
    putenv(“TZ=Asia/Calcutta”);
    in my php file
    Result - dotProject displays the time correctly when I print out an echo date…but the timestamp stored in the db is still the server time.

Any help on this will be appreciated.


#2

That’s gonna be a rough one. I have not yet found a way to manipulate the time zone as it relates to a DH MySQL server.

Remember that the DreamHost MySQL servers are different than your webserver, and I know of no one who has been successful in modifying that setting.

You could include processing in your CRUD code to make the adjustments as necessary based on a program user’s timezone and then “autocorrect” before writing the data to the database, but although it has been discussed for several years now in the dotproject community, it has not yet been done.

–rlparker


#3

Hi… very recent dotProject core contributor here.

In the current releases (2.x), you can’t do much about it. On the Head (trunk) development, my team had implemented user-specific timezones, but unfortunately, that is not going to be released.

In the meantime, we’ve branched into a new project - http://web2project.net/ - and have our first release scheduled in the next week or so. While that first release won’t have user-specific timezones, it’s on the agenda for the following release.

We needed to take care of a number of security and performance issues first.

Keith Casey
http://CaseySoftware.com/blog - DH customer since Sept '06


#4

Thanks for the information Casey! I’m gonna browse on over to take a look at web2project. :wink:

–rlparker


#5

ThanQ rlparker. since i am just starting out with dotProject am gonna work with the server timezone for now…i dont wanna dip my hands into the code part just yet…


#6

web2project sounds interesting…would definitely like to try it out…till thn…fingers crossed…

==peAce==


#7

I’m not sure where Keith gets his information, but he is badly misinformed to say that trunk code is not going to be released. I have not seen anything about the timezone code that would make it not able to be released. But then I am a current dotProject developer, not a former developer like Keith.

Adam Donnison
dotProject admin and core developer
http://www.dotproject.net/


#8

Functioning and released Timezone code would be a “Good Thing™”! :wink:

–rlparker


#9

My apologies Adam, that was the last information I had. If that it changed, I’m glad to hear it.

I spent a lot of time on Head working on a number of things and I’m looking forward to them making it out there.

My apologies,
keith


#10

Hey folks, I hacked the date class constructor so that you can offset for your timezone.

Go in to \dotproject\classes

open date.class.php

find:
class CDate extends Date {

replace with:
class CDate extends Date {

/*

  • Overloaded constructor
    */

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 = 3; // How man hours different are you? (always positive)
// If your clock is ahead of the server, uncomment this line:
$this->addSeconds(6060$offset);
// If your clock is behind of the server, uncomment this line:
// $this->subtractSeconds(6060$offset);
}

Make sure you change offset to match the number of hours difference you are. Ex. I’m EST, so my offset was 3 (servers are in PST), if you live in UK, then your offset is 8 (I think). Make sure you have the correct lines commented and uncommented… Have fun.


#11

I found a simple solution at

http://www.rain-forest-forum.com/how-to-enable-or-set-timezone-in-dotproject-t81.html