From aabd9232482648832e25b4e293f64358e54c0879 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Mar 2014 09:49:10 +0100 Subject: [PATCH] Try to remove warning --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b6df6ff335c..ae1b91ef712 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1015,7 +1015,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) if (method_exists('DateTime','getTimestamp') && empty($conf->global->MAIN_OLD_DATE)) { - if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get()); + if (empty($gm)) + { + $default_timezone=@date_default_timezone_get(); + $localtz = new DateTimeZone($default_timezone); + } else $localtz = new DateTimeZone('UTC'); $dt = new DateTime(null,$localtz); $dt->setDate($year,$month,$day);