Merge pull request #22267 from frederic34/patch-8

strftime is deprecated in php8.1
This commit is contained in:
Laurent Destailleur 2022-10-06 12:18:43 +02:00 committed by GitHub
commit 10d40402b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -757,14 +757,14 @@ class BonPrelevement extends CommonObject
$error = 0; $error = 0;
$datetimeprev = time(); $datetimeprev = dol_now('gmt');
//Choice the date of the execution direct debit //Choice the date of the execution direct debit
if (!empty($executiondate)) { if (!empty($executiondate)) {
$datetimeprev = $executiondate; $datetimeprev = $executiondate;
} }
$month = strftime("%m", $datetimeprev); $month = dol_print_date($datetimeprev, "%m", 'gmt');
$year = strftime("%Y", $datetimeprev); $year = dol_print_date($datetimeprev, "%Y", 'gmt');
$this->invoice_in_error = array(); $this->invoice_in_error = array();
$this->thirdparty_in_error = array(); $this->thirdparty_in_error = array();
@ -1743,8 +1743,8 @@ class BonPrelevement extends CommonObject
// Date d'echeance C1 // Date d'echeance C1
fputs($this->file, " "); fputs($this->file, " ");
fputs($this->file, strftime("%d%m", $this->date_echeance)); fputs($this->file, dol_print_date($this->date_echeance, "%d%m", 'gmt'));
fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); fputs($this->file, substr(dol_print_date($this->date_echeance, "%y", 'gmt'), 1));
// Raison Sociale Destinataire C2 // Raison Sociale Destinataire C2
@ -1969,8 +1969,8 @@ class BonPrelevement extends CommonObject
// Date d'echeance C1 // Date d'echeance C1
fputs($this->file, " "); fputs($this->file, " ");
fputs($this->file, strftime("%d%m", $this->date_echeance)); fputs($this->file, dol_print_date($this->date_echeance, "%d%m", 'gmt'));
fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); fputs($this->file, substr(dol_print_date($this->date_echeance, "%y", 'gmt'), 1));
// Raison Sociale C2 // Raison Sociale C2