diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8bf84f45cde..ded7d4fd238 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -691,11 +691,11 @@ if ($resql) // Date creation if (! empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($obj->datec, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; } // Date update if (! empty($arrayfields['a.tms']['checked'])) { - print ''.dol_print_date($obj->datem, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').''; } if (! empty($arrayfields['a.percent']['checked'])) { // Status/Percent diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53bac454c8c..dddd8506eb1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1790,9 +1790,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 { - // TODO Remove this. - // This part of code should not be used. + // TODO Remove this. This part of code should not be used. dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR); + //if (function_exists('debug_print_backtrace')) debug_print_backtrace(); // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' $syear = (! empty($reg[1]) ? $reg[1] : ''); $smonth = (! empty($reg[2]) ? $reg[2] : ''); @@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $smin = (! empty($reg[5]) ? $reg[5] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : ''); - $time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); + $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); } else diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 3751935b81c..2985386676f 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -226,8 +226,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon'; - print ''.dol_print_date($obj->date_start, 'day').' '.$langs->trans($listhalfday[$starthalfday]); - print ''.dol_print_date($obj->date_end, 'day').' '.$langs->trans($listhalfday[$endhalfday]); + print ''.dol_print_date($db->jdate($obj->date_start), 'day').' '.$langs->trans($listhalfday[$starthalfday]); + print ''.dol_print_date($db->jdate($obj->date_end), 'day').' '.$langs->trans($listhalfday[$endhalfday]); print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''.$holidaystatic->LibStatut($obj->status, 3).''; print ''; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index d4193118c75..35c60248ccf 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -503,7 +503,9 @@ while ($i < min($num, $limit)) print $val['css']; if ($cssforfield || $val['css']) print '"'; print '>'; - print $object->showOutputField($val, $key, $obj->$key, ''); + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7b61bd7c1b5..02e441adba0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -640,6 +640,7 @@ while ($i < min($num, $limit)) if ($cssforfield || $val['css']) print '"'; print '>'; if ($key == 'fk_statut') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++;