Project task and timezone issue

Hi everyone!

I am not a developer, just a simple end user and I am using Dolibarr for managing my one man show consulting company.

Whenever I want to add a task to a specific project, I always receive the following massage:

Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::__construct() expects parameter 2 to be DateTimeZone, null given’ in C:\dolibarr\www\dolibarr\htdocs\core\lib\functions.lib.php:1057 Stack trace: #0 C:\dolibarr\www\dolibarr\htdocs\core\lib\functions.lib.php(1057): DateTime->__construct(’’, NULL) #1 C:\dolibarr\www\dolibarr\htdocs\projet\tasks.php(86): dol_mktime(‘15’, ‘48’, 0, ‘11’, ‘06’, ‘2014’, ‘user’) #2 {main} thrown in C:\dolibarr\www\dolibarr\htdocs\core\lib\functions.lib.php on line 1057

I have no idea how to solve this, unless somebody volunteers for this task, by sending me a manual, if exist, or also is willing to work this through a shared desktop.

Thank you all in advance.

Dragan

Hi,

I do have tje same issue… I´ve tried different timestamps. Same message.

Regards Patrick

1 Like

Hi Dolibarr theam,

I think it’s a problem withing the 3.6 and 3.6.1 update, I’ve used the 6.4.1 version and it works okay! would any one pring some help here please?

Hi team,

I’ve found this:

the problem is corrected by adding the below linge:

$localtz = new DateTimeZone($default_timezone);

in the folder: htdocs/core/lib/functions.lib.php ligne 1050
catch(Exception $e)
{
dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION[“dol_tz_string”], LOG_WARNING);
$default_timezone=@date_default_timezone_get();
$localtz = new DateTimeZone($default_timezone);
}

thanks

The following fix will be available with 3.6.2

— a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1053,7 +1053,11 @@
$default_timezone=@date_default_timezone_get();
}
}

  •   else $localtz = new DateTimeZone('UTC');
    
  •   if (empty($localtz)) {
    
  •   	$localtz = new DateTimeZone('UTC');
    
  •   }
    
  •   $dt = new DateTime(null,$localtz);
      $dt-\>setDate($year,$month,$day);
      $dt-\>setTime((int) $hour, (int) $minute, (int) $second);
2 Likes

When will 3.6.2 be released? Thanks for your support.

Greets Patrick

Rename C:\dolibarr\www\dolibarr\htdocs\core\lib\functions.lib.OLD.php, Copy and paste functions.lib.php

copy from where ?

Project task and timezone issue is fixed with 3.6.2 update!

THANK YOU!