From de33a568cbbf0b108e699389368fc1dc7e704d19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Dec 2011 16:26:47 +0100 Subject: [PATCH] Qual: All dolibarr code now use dol_xxx function to manage dates --- htdocs/core/db/mssql.class.php | 13 ++++++++----- htdocs/core/db/mysql.class.php | 10 +++++----- htdocs/core/db/mysqli.class.php | 10 +++++----- htdocs/core/db/pgsql.class.php | 10 +++++----- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 63ff3e9c20e..87a6c71b188 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -542,6 +542,7 @@ class DoliDBMssql /** * Escape a string to insert data. + * * @param stringtoencode String to escape * @return string String escaped */ @@ -554,19 +555,21 @@ class DoliDBMssql /** * Convert (by PHP) a GM Timestamp date into a PHP server TZ to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica - * @param param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { - return adodb_strftime("%Y-%m-%d %H:%M:%S",$param); + return dol_print_date($param,"%Y-%m-%d %H:%M:%S",true); } /** * Convert (by PHP) a PHP server TZ string date into a GM Timestamps date * 19700101020000 -> 3600 with TZ+1 - * @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @return date Date TMS + * + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @return date Date TMS */ function jdate($string) { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 6b661073089..a4c6f85c26a 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -537,20 +537,20 @@ class DoliDBMysql * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica * - * @param param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { - return adodb_strftime("%Y%m%d%H%M%S",$param); + return dol_print_date($param,"%Y%m%d%H%M%S",true); } /** * Convert (by PHP) a PHP server TZ string date into a GM Timestamps date * 19700101020000 -> 3600 with TZ+1 * - * @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @return date Date TMS + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @return date Date TMS */ function jdate($string) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 345c88a4448..63ca6341dab 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -549,20 +549,20 @@ class DoliDBMysqli * Convert (by PHP) a GM Timestamp date into a PHP server TZ to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica * - * @param param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { - return adodb_strftime("%Y%m%d%H%M%S",$param); + return dol_print_date($param,"%Y%m%d%H%M%S",true); } /** * Convert (by PHP) a PHP server TZ string date into a GM Timestamps date * 19700101020000 -> 3600 with TZ+1 * - * @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @return date Date TMS + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @return date Date TMS */ function jdate($string) { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index af5a339dd54..f4ece94f448 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -693,20 +693,20 @@ class DoliDBPgsql * Convert (by PHP) a GM Timestamp date into a GM string date to insert into a date field. * Function to use to build INSERT, UPDATE or WHERE predica * - * @param param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { - return adodb_strftime("%Y-%m-%d %H:%M:%S",$param); + return dol_print_date($param,"%Y-%m-%d %H:%M:%S",true); } /** * Convert (by PHP) a PHP server TZ string date into a GM Timestamps date * 19700101020000 -> 3600 with TZ+1 * - * @param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @return date Date TMS + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @return date Date TMS */ function jdate($string) {