diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3282d916745..0786ea6db3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2781,7 +2781,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs function dol_strftime($fmt, $ts = false, $is_gmt = false) { if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range - return ($is_gmt) ? @gmstrftime($fmt, $ts) : @strftime($fmt, $ts); + return ($is_gmt) ? @gmstrftime($fmt, $ts) : @dol_print_date($ts, $fmt); } else { return 'Error date into a not supported range'; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index a07c7868c3c..292bbb82eaf 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1612,7 +1612,7 @@ function hexbin($hexa) */ function numero_semaine($time) { - $stime = strftime('%Y-%m-%d', $time); + $stime = dol_print_date($time, '%Y-%m-%d'); if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/i', $stime, $reg)) { // Date est au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS' diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 95bc0dc27d2..f7937701a3b 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -262,7 +262,7 @@ class mod_facture_terre extends ModeleNumRefFactures return $ref; } elseif ($mode == 'next') { $date = $invoice->date; // This is invoice date (not creation date) - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m"); if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php index c27c36c8849..72ea06d05ab 100644 --- a/htdocs/core/modules/mrp/mod_mo_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -142,7 +142,7 @@ class mod_mo_standard extends ModeleNumRefMos //$date=time(); $date = $object->date_creation; - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m"); if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php index f6b674cf3f6..b63aff30a84 100644 --- a/htdocs/core/modules/product_batch/mod_lot_standard.php +++ b/htdocs/core/modules/product_batch/mod_lot_standard.php @@ -144,7 +144,7 @@ class mod_lot_standard extends ModeleNumRefBatch //$date=time(); $date = dol_now(); - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m"); if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php index 42d55ff92b7..5f569baa498 100644 --- a/htdocs/core/modules/product_batch/mod_sn_standard.php +++ b/htdocs/core/modules/product_batch/mod_sn_standard.php @@ -144,7 +144,7 @@ class mod_sn_standard extends ModeleNumRefBatch //$date=time(); $date = dol_now(); - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m"); if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a7ae18ee1d..d034d7ebd7d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3889,8 +3889,8 @@ class Product extends CommonObject } if (empty($year)) { - $year = strftime('%Y', time()); - $month = strftime('%m', time()); + $year = dol_print_date(time(), '%Y'); + $month = dol_print_date(time(), '%m'); } elseif ($year == -1) { $year = ''; $month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year. diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 0416064f466..11c3dc31649 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -1146,8 +1146,8 @@ if ($resql) { $productidselected = $key; $productlabelselected = $val; } - $datebefore = dol_get_first_day($year ? $year : strftime("%Y", time()), $month ? $month : 1, true); - $dateafter = dol_get_last_day($year ? $year : strftime("%Y", time()), $month ? $month : 12, true); + $datebefore = dol_get_first_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 1, true); + $dateafter = dol_get_last_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 12, true); $balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 9a447d213db..d8cb47f17fe 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1641,8 +1641,8 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) { $productidselected = $key; $productlabelselected = $val; } - $datebefore = dol_get_first_day($year ? $year : strftime("%Y", time()), $month ? $month : 1, true); - $dateafter = dol_get_last_day($year ? $year : strftime("%Y", time()), $month ? $month : 12, true); + $datebefore = dol_get_first_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 1, true); + $dateafter = dol_get_last_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 12, true); $balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore); $balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter); diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 8be73099cac..6d7f9656d73 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -327,7 +327,7 @@ if (getDolGlobalString('PROJECT_TASK_TIME_YEAR')) { print '
| '.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now).' | '; + print ''.$langs->trans("ActivityOnProjectThisYear").': '.dol_print_date($now, "%Y").' | '; print ''.$langs->trans("Time").' | '; print "