From 35adb2808f45130e0aea777f41c5db4c1c2c4304 Mon Sep 17 00:00:00 2001 From: solocla Date: Thu, 24 Sep 2026 11:08:03 +0200 Subject: [PATCH] fixed timezone --- cron/class_report.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cron/class_report.php b/cron/class_report.php index 89cc41f..92d4cce 100644 --- a/cron/class_report.php +++ b/cron/class_report.php @@ -20,6 +20,13 @@ if (PHP_SAPI !== 'cli') { date_default_timezone_set('Europe/Rome'); +// --only-at=17 : esce senza fare nulla se in Italia non sono le 17 (server in UTC) +foreach ($argv as $a) { + if (preg_match('/^--only-at=(\d{1,2})$/', $a, $m) && (int) date('G') !== (int) $m[1]) { + exit(0); + } +} + $root = dirname(__DIR__); chdir($root); require_once $root . '/public/class/db-functions.php'; // include anche vendor/autoload.php