From 425c725443c21b27431648d99e29d9cc3901618f Mon Sep 17 00:00:00 2001 From: n Date: Sat, 30 Mar 2024 21:59:38 +0100 Subject: [PATCH] replace deprecated strftime() function https://www.php.net/manual/en/function.strftime.php --- include/standard.inc.php | 2 +- include/timer.inc.php | 14 +++----------- modules/goldbook.php | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/include/standard.inc.php b/include/standard.inc.php index 5cecde0..fd58e40 100644 --- a/include/standard.inc.php +++ b/include/standard.inc.php @@ -295,7 +295,7 @@ function addlog($url) createfile("$File.csv"); } - $date = strftime("%d/%m/%Y", time()); + $date = date_format(date_create(), "d/m/Y"); $string = sprintf("\"".$date."\",\"".iheure()."\",\"".$_SERVER["REMOTE_ADDR"]."\",\"".$_SERVER["HTTP_REFERER"]."\",\"".$_SERVER["HTTP_USER_AGENT"]."\"\n"); diff --git a/include/timer.inc.php b/include/timer.inc.php index 8fca361..39826bb 100644 --- a/include/timer.inc.php +++ b/include/timer.inc.php @@ -6,11 +6,7 @@ function settimer($TimerName, $String) { $FileTimerName = "modules/timers/$TimerName.csv"; - if (strftime("%m", time()) < 10) { - $Date = strftime("%Y%0m%d%H%M%S", time()); - } else { - $Date = strftime("%Y%m%d%H%M%S", time()); - } + $Date = date_format(date_create(), "YmdHis"); $fp = fopen("$FileTimerName", "w+"); $Ligne = sprintf("\"".$Date."\",\"".$String."\"\n"); @@ -26,11 +22,7 @@ function timer($TimerName, $TimerNb) $FileTimerN = "modules/timers/$TimerName.csv"; - if (strftime("%m", time()) < 10) { - $Date = strftime("%Y%0m%d%H%M%S", time()); - } else { - $Date = strftime("%Y%m%d%H%M%S", time()); - } + $Date = date_format(date_create(), "YmdHis"); if (!file_exists("$FileTimerN")) { $timer = false; @@ -41,7 +33,7 @@ function timer($TimerName, $TimerNb) fclose($fp); $FileDate = $data[0]; - $Date = strftime("%Y%m%d%H%M%S", time()); + $Date = date_format(date_create(), "YmdHis"); $String = $data[1]; diff --git a/modules/goldbook.php b/modules/goldbook.php index 7d19c3c..e49cb61 100644 --- a/modules/goldbook.php +++ b/modules/goldbook.php @@ -49,7 +49,7 @@ if (!(file_exists("modules/goldbook/$GoldbookFile.csv"))) { // ajout des messages if ($param == "postgb") { if ($VMessage != "" && isset($_POST['piejacon'])) { - $date = strftime("%d/%m/%Y", time()); + $date = date_format(date_create(), "d/m/Y"); $iheure = date("H:i"); $VMessage = ereg_replace("<", "<", $VMessage); $VMessage = ereg_replace(">", ">", $VMessage); -- 2.40.1