mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 12:31:26 +01:00
Fix for PHP < 5.3
This commit is contained in:
@@ -83,7 +83,7 @@ function getServerTimeZoneString()
|
||||
function getServerTimeZoneInt($refgmtdate='now')
|
||||
{
|
||||
global $conf;
|
||||
if (class_exists('DateTime') && ! empty($conf->global->MAIN_NEW_DATE))
|
||||
if (method_exists('DateTimeZone','getOffset') && ! empty($conf->global->MAIN_NEW_DATE))
|
||||
{
|
||||
// Method 1 (include daylight)
|
||||
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
|
||||
|
||||
@@ -960,7 +960,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
if ($second< 0 || $second > 60) return '';
|
||||
}
|
||||
|
||||
if (class_exists('DateTime') && ! empty($conf->global->MAIN_NEW_DATE))
|
||||
if (method_exists('DateTime','getTimestamp') && ! empty($conf->global->MAIN_NEW_DATE))
|
||||
{
|
||||
if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get());
|
||||
else $localtz = new DateTimeZone('UTC');
|
||||
|
||||
Reference in New Issue
Block a user