From 57a869683d5a7b20666f54be9a136f784fc2f283 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Jan 2013 11:28:06 +0100 Subject: [PATCH] Fix date function --- ChangeLog | 1 + htdocs/core/lib/date.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39f8bf27724..d5b181f8990 100644 --- a/ChangeLog +++ b/ChangeLog @@ -105,6 +105,7 @@ For developers: - New: Add PRODUCT_PRICE_MODIFY trigger. - New: Created function to retrieve total amount of discount of an invoice/proposal... - New: We can use a dynamic value ($conf->global->XXX for example) into titles of menus. +- New: Use PHP classes DateTime* for some data functions instead of adodb - Qual: Renamed SUPPLIER_INVOICE_BUILDDOC trigger to BILL_SUPPLIER_BUILDDOC - Qual: Renamed INVOICE_SUPPLIER_DELETE trigger to BILL_SUPPLIER_DELETE - Qual: Renamed SUPLIER_ORDER_BUILDDOC trigger to ORDER_SUPPLIER_BUILDDOC diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 921cfa392a1..c7a7e1240dd 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -88,7 +88,7 @@ function getServerTimeZoneInt($refgmtdate='now') // 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'); if ($refgmtdate == 'now') $newrefgmtdate=$yearref.'-'.$monthref.'-'.$dayref; - elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-05-15'; + elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-08-01'; else $newrefgmtdate=$yearref.'-01-01'; $localtz = new DateTimeZone(getServerTimeZoneString()); $localdt = new DateTime($newrefgmtdate, $localtz); @@ -773,7 +773,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha global $langs; dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday); - + // Check parameters if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day'; if (! is_int($timestampEnd) && ! is_float($timestampEnd)) return 'ErrorBadParameter_num_open_day';