diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 6f5a75b35ab..7d6afd22457 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -64,8 +64,6 @@ abstract class DoliDB implements Database public $ok; public $error; - - /** * Define sort criteria of request * @@ -94,5 +92,22 @@ abstract class DoliDB implements Database return ''; } } + + /** + * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) + * 19700101020000 -> 3600 with TZ+1 and gmt=0 + * 19700101020000 -> 7200 whaterver is TZ if gmt=1 + * + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ + * @return date Date TMS + */ + function jdate($string, $gm=false) + { + $string=preg_replace('/([^0-9])/i','',$string); + $tmp=$string.'000000'; + $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); + return $date; + } } diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 0e1b1a2ca0c..ae8e6ea5ce6 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -553,23 +553,6 @@ class DoliDBMssql extends DoliDB return dol_print_date($param,"%Y-%m-%d %H:%M:%S"); } - /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 - * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS - */ - function jdate($string, $gm=false) - { - $string=preg_replace('/([^0-9])/i','',$string); - $tmp=$string.'000000'; - $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); - return $date; - } - /** * Format a SQL IF * diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 46b16113a26..bd6c2794b17 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -531,23 +531,6 @@ class DoliDBMysql extends DoliDB return dol_print_date($param,"%Y%m%d%H%M%S"); } - /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 - * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS - */ - function jdate($string, $gm=false) - { - $string=preg_replace('/([^0-9])/i','',$string); - $tmp=$string.'000000'; - $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); - return $date; - } - /** * Format a SQL IF * diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index ece1ff86532..f530656cc7f 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -541,23 +541,6 @@ class DoliDBMysqli extends DoliDB return dol_print_date($param,"%Y%m%d%H%M%S"); } - /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 - * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS - */ - function jdate($string, $gm=false) - { - $string=preg_replace('/([^0-9])/i','',$string); - $tmp=$string.'000000'; - $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); - return $date; - } - /** * Format a SQL IF * diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index aa31f5616c8..7b2961e623c 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -752,23 +752,6 @@ class DoliDBPgsql extends DoliDB return dol_print_date($param,"%Y-%m-%d %H:%M:%S"); } - /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 - * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS - */ - function jdate($string, $gm=false) - { - $string=preg_replace('/([^0-9])/i','',$string); - $tmp=$string.'000000'; - $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); - return $date; - } - /** * Format a SQL IF * diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 36f583011e4..67dc9593042 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -674,24 +674,6 @@ class DoliDBSqlite extends DoliDB return dol_print_date($param,"%Y%m%d%H%M%S"); } - /** - * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) - * 19700101020000 -> 3600 with TZ+1 and gmt=0 - * 19700101020000 -> 7200 whaterver is TZ if gmt=1 - * - * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS - */ - function jdate($string, $gm=false) - { - $string=preg_replace('/([^0-9])/i','',$string); - $tmp=$string.'000000'; - $date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm); - return $date; - } - - /** * Format a SQL IF *