Anonymous Login
2020-08-07 16:39 PDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001414Pending RequestsTaskspublic2016-12-26 10:25
Assigned To 
Product Version 
Target VersionFixed in Version 
Summary0001414: Display of overdue wrong for same day tasks
Descriptioncreate task in projdesigner:
for dates, it proposes: start=now, end = now + 1 h, duration = 1 h

store task. Now time on my computer is approx start + 1 min. Task end in ca. 1 hour. task is displayed as overdue .

TagsNo tags attached.
Attached Files




sasquatch58 (reporter)

If you're located in Germany (UTC+1h) then this might be related to TZ offset issues in determining actual overdue.
This has had quite a bit of discussion in the old forums & I have sucessfully fixed the core issues (still gantt issues) in my build but Keith is holding off on the git mods. One issue about introducing the fix is the ability to correct the historic offsets in the stored user (date/ time) data. I haven't spent any time on the sql code yet.
Cheers, Sasquatch


caseydk (administrator)

I was just testing this on the develop branch and everything appears to work as expected.

Using the patch for, this shouldn't come up as easily anyway.


opto (manager)

but it was in the middle of the day, so no TZ assumed as origin.



opto (manager)

historic offsets:

if they are not corrected, one could just store the start time of the correction in the db.
Then, if necessary, the user can figure out or apply a correction if needed, but we make sure that the fututre tasks will be ok.

If I understand correctly, at the moment, we keep the future tasks wrong because the fix would not fix the past tasks.

I rather have the future tasks ok, the old ones will be obsolete soon anyway.


sasquatch58 (reporter)

The fix is quite easy & covers a couple of issues.
1. Wrong logging of database change times (currently offset by locale TZ difference to London
2. Wrong results when getting some dates back from DB because of the London TZ base.

Typical fix is to change away from TZ defaults & references of "Europe/London" to the correct "UTC". The former adjusts for daylight saving and the latter doesn't.
Unfortunately my notes/ fixes on this were in the old Forums and now no longer available. Look in file classes/w2p/Utilities/Date.class.php line 21 and classes/w2p/Core/CappUI.php line 250, 275
I did test against various user timezones and found no issues.
My thinking on the sql code was to set up a script to a/ change the code and b/ offset the stored data by the calculated offset according to system settings. All fraught with database danger & challenging to the novice.
Do you have my pm address?

Cheers, Sasquatch


sasquatch58 (reporter)

Last edited: 2013-11-28 00:31

Aha - found my local git commits from playing around in August :-)
---------------------- classes/w2p/Core/CAppUI.class.php ----------------------
index 23969e1..01a8bd9 100644
@@ -250,7 +250,7 @@ class w2p_Core_CAppUI
             $q->addWhere("sysval_value_id = '$timezoneOffset'");
             $userTimezone = $q->loadResult();
- $userTimezone = (strlen($userTimezone) == 0) ? 'Europe/London' : $userTimezone;
+ $userTimezone = (strlen($userTimezone) == 0) ? 'UTC' : $userTimezone;
             $userTZ = new DateTimeZone($userTimezone);
             echo '<span class="error">';
@@ -275,7 +275,7 @@ class w2p_Core_CAppUI
         $userTZ = $this->getPref('TIMEZONE');
         $userTimezone = new DateTimeZone($userTZ);
- $systemTimezone = new DateTimeZone('Europe/London');
+ $systemTimezone = new DateTimeZone('UTC');
         $ts = new DateTime($datetime, $userTimezone);
@@ -291,7 +291,7 @@ class w2p_Core_CAppUI
         $userTimezone = $this->getPref('TIMEZONE');
         $userTZ = new DateTimeZone($userTimezone);
- $systemTZ = new DateTimeZone('Europe/London');
+ $systemTZ = new DateTimeZone('UTC');
         $ts = new DateTime($datetime, $systemTZ);
--------------------- classes/w2p/Database/Query.class.php ---------------------
index e7fcf02..9abeba6 100644
@@ -576,7 +576,7 @@ class w2p_Database_Query {
     public function dbfnNowWithTZ() {
         $df = 'Y-m-d H:i:s';
- $defaultTZ = 'Europe/London';
+ $defaultTZ = 'UTC';
         $systemTZ = new DateTimeZone($defaultTZ);
         $ts = new DateTime();


opto (manager)

I think the old Forums are still online and can be searched .they are just closed for new Posts.



caseydk (administrator)

I just double checked.. the only references to Europe/London were in the unit tests which I just updated.

Are you guys still seeing the issue?


sasquatch58 (reporter)

Last edited: 2013-12-21 22:39

My last round of testing after Keith had fixed all the Europe/ London issues came up good - no issue apparent with timezones.
The other thing picked up - looks like this has corrected the gantt display issues as well :-) No longer getting offsets in displayed bars that were very obvious in my locale (NZ) with the 12 or 13h offset from UTC.
Thanks Keith


caseydk (administrator)

So do we call this resolved?


sasquatch58 (reporter)

Sorry Keith, a check with brand w2p 3.1 pre and a brand new db gives the same overdue error. New picture tells a thousand words


caseydk (administrator)

I've been digging around on this one. Here is the code in question:

It appears that $now is always one hour in the future.. is everyone else seeing the same?

-Issue History
Date Modified Username Field Change
2013-11-27 04:17 opto New Issue
2013-11-27 09:47 sasquatch58 Note Added: 0003085
2013-11-27 13:58 caseydk Note Added: 0003088
2013-11-27 13:58 caseydk Status new => feedback
2013-11-27 21:17 caseydk Project v3.0 Release => v3.2 Release
2013-11-27 21:19 caseydk Project v3.2 Release => v3.1 Release
2013-11-27 22:18 opto Note Added: 0003089
2013-11-27 23:53 opto Note Added: 0003090
2013-11-28 00:22 sasquatch58 Note Added: 0003091
2013-11-28 00:30 sasquatch58 Note Added: 0003092
2013-11-28 00:31 sasquatch58 Note Edited: 0003092
2013-11-28 03:53 opto Note Added: 0003093
2013-12-21 22:13 caseydk Note Added: 0003135
2013-12-21 22:35 sasquatch58 Note Added: 0003136
2013-12-21 22:39 sasquatch58 Note Edited: 0003136
2013-12-22 18:55 caseydk Note Added: 0003143
2013-12-25 17:55 sasquatch58 Note Added: 0003147
2013-12-25 17:58 sasquatch58 File Added: overdue errors.PNG
2014-01-05 12:07 caseydk Project v3.1 Release => v3.2 Release
2014-01-21 17:58 caseydk Target Version => 3.2
2014-01-25 00:41 caseydk Category General => Tasks
2014-03-27 09:44 caseydk Project v3.2 Release => v4.0 Release (Planning)
2014-06-10 22:49 caseydk Target Version 3.2 => 4.0
2014-06-15 22:54 caseydk Note Added: 0003490
2016-12-26 10:25 caseydk Project v4.0 Release (Planning) => Pending Requests
+Issue History