mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix: When select_date is called with '' as preselected date,
automatic user date was not correctly et (We must set a date into PHP server timezone area) Fix: First param of select_date must always be forged with a dolibarr date function and not time(). New: Add a page for tests.
This commit is contained in:
@@ -1058,7 +1058,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
|
||||
|
||||
/**
|
||||
* Return date for now. We should always use this function without parameters (that means GMT time)
|
||||
* Return date for now. In mot cases, we use this function without parameters (that means GMT time).
|
||||
*
|
||||
* @param string $mode 'gmt' => we return GMT timestamp,
|
||||
* 'tzserver' => we add the PHP server timezone
|
||||
@@ -1068,7 +1068,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
*/
|
||||
function dol_now($mode='gmt')
|
||||
{
|
||||
// Note that gmmktime and mktime return same value (GMT) whithout parameters
|
||||
// Note that gmmktime and mktime return same value (GMT) when used without parameters
|
||||
//if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead
|
||||
if ($mode == 'gmt') $ret=time(); // Time for now at greenwich.
|
||||
else if ($mode == 'tzserver') // Time for now with PHP server timezone added
|
||||
@@ -1083,7 +1083,7 @@ function dol_now($mode='gmt')
|
||||
$tzsecond=getParentCompanyTimeZoneInt(); // Contains tz+dayling saving time
|
||||
$ret=dol_now('gmt')+($tzsecond*3600);
|
||||
}*/
|
||||
else if ($mode == 'tzuser') // Time for now with user timezone is added
|
||||
else if ($mode == 'tzuser') // Time for now with user timezone added
|
||||
{
|
||||
//print 'eeee'.time().'-'.mktime().'-'.gmmktime();
|
||||
$offsettz=(empty($_SESSION['dol_tz'])?0:$_SESSION['dol_tz'])*60*60;
|
||||
|
||||
Reference in New Issue
Block a user