From 1dd6e790fc87b6d4649fead8d319def9b1518801 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 3 May 2025 16:51:05 +0500 Subject: fix: implicit conversion --- src/utils.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/utils.php b/src/utils.php index 6356cfb..87d96c6 100644 --- a/src/utils.php +++ b/src/utils.php @@ -41,10 +41,10 @@ function str_safe(string $s, int|null $max_length, bool $remove_new_lines = true function format_timestamp(int $timestamp_secs) { - $days = floor($timestamp_secs / (60 * 60 * 24)); - $hours = floor($timestamp_secs / (60 * 60) % 24); - $minutes = floor($timestamp_secs % (60 * 60) / 60); - $seconds = floor($timestamp_secs % 60); + $days = (int) floor($timestamp_secs / (60.0 * 60.0 * 24.0)); + $hours = (int) floor(round($timestamp_secs / (60 * 60)) % 24); + $minutes = (int) floor(round($timestamp_secs % (60 * 60)) / 60); + $seconds = (int) floor($timestamp_secs % 60); if ($days == 0 && $hours == 0 && $minutes == 0) { return "$seconds second" . ($seconds > 1 ? "s" : ""); -- cgit v1.2.3