Try a fix for dol_time_plus_duree when date is 2017-09-01 00:00 and
timezone > 0
This commit is contained in:
parent
e9e6a8e5ad
commit
214bad26db
@ -115,6 +115,8 @@ function getServerTimeZoneInt($refgmtdate='now')
|
|||||||
*/
|
*/
|
||||||
function dol_time_plus_duree($time, $duration_value, $duration_unit)
|
function dol_time_plus_duree($time, $duration_value, $duration_unit)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
if ($duration_value == 0) return $time;
|
if ($duration_value == 0) return $time;
|
||||||
if ($duration_unit == 'h') return $time + (3600*$duration_value);
|
if ($duration_unit == 'h') return $time + (3600*$duration_value);
|
||||||
if ($duration_unit == 'w') return $time + (3600*24*7*$duration_value);
|
if ($duration_unit == 'w') return $time + (3600*24*7*$duration_value);
|
||||||
@ -128,7 +130,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
|
|||||||
if ($duration_unit == 'y') { $deltastring.="Y"; }
|
if ($duration_unit == 'y') { $deltastring.="Y"; }
|
||||||
|
|
||||||
$date = new DateTime();
|
$date = new DateTime();
|
||||||
$date->setTimezone(new DateTimeZone('UTC'));
|
if (! empty($conf->global->MAIN_DATE_IN_MEMORY_ARE_GMT)) $date->setTimezone(new DateTimeZone('UTC'));
|
||||||
$date->setTimestamp($time);
|
$date->setTimestamp($time);
|
||||||
$interval = new DateInterval($deltastring);
|
$interval = new DateInterval($deltastring);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user