From b1a885ac229892bac528e6fea4e011a1b240867b Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 10 Oct 2025 20:55:37 +0500 Subject: initial commit --- lib/time.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/time.php (limited to 'lib') diff --git a/lib/time.php b/lib/time.php new file mode 100644 index 0000000..dc8b54f --- /dev/null +++ b/lib/time.php @@ -0,0 +1,21 @@ + 1 ? "s" : ""); + } else if ($years == 0 && $days == 0 && $hours == 0) { + return "$minutes minute" . ($minutes > 1 ? "s" : ""); + } else if ($years == 0 && $days == 0) { + return "$hours hour" . ($hours > 1 ? "s" : ""); + } else if ($years == 0) { + return "$days day" . ($days > 1 ? "s" : ""); + } else { + return "$years year" . ($years > 1 ? "s" : ""); + } +} \ No newline at end of file -- cgit v1.2.3