Clean code

This commit is contained in:
Laurent Destailleur 2020-10-07 00:26:03 +02:00
parent f16a58a62c
commit 77788a0591
2 changed files with 3 additions and 2 deletions

View File

@ -5315,6 +5315,7 @@ class Form
} }
// Analysis of the pre-selection date // Analysis of the pre-selection date
$reg = array();
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) // deprecated usage if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) // deprecated usage
{ {
// Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' // Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'

View File

@ -87,10 +87,10 @@ abstract class DoliDB implements Database
* @param int $param Date TMS to convert * @param int $param Date TMS to convert
* @return string Date in a string YYYY-MM-DD HH:MM:SS * @return string Date in a string YYYY-MM-DD HH:MM:SS
*/ */
public function idate($param) public function idate($param, $tzoutput = 'tzserver')
{ {
// TODO GMT $param should be gmt, so we should add tzouptut to 'gmt' // TODO GMT $param should be gmt, so we should add tzouptut to 'gmt'
return dol_print_date($param, "%Y-%m-%d %H:%M:%S"); return dol_print_date($param, "%Y-%m-%d %H:%M:%S", 'tzserver');
} }
/** /**