- * @param string $posted_date MySQL-formatted date string (YYYY-MM-DD HH:MM:SS)
- * @param string $format (optional) Parsed with sprintf()
- * @param bool $compare_time Compare date (false) or date and time (true). "true" is default.
- * <tt>%1$d %2$s ago</tt>, e.g. 22 hours ago, 1 minute ago
+ * @param string|null $posted_date MySQL-formatted date string (YYYY-MM-DD HH:MM:SS)
+ * @param bool $compare_time Compare date (false) or date and time (true). "true" is default.
+ * @param ClockInterface|null $clock
+ * <tt>%1$d %2$s ago</tt>, e.g. 22 hours ago, 1 minute ago
- public static function getRelativeDate(string $posted_date = null, string $format = null, bool $compare_time = true): string
+ public static function getRelativeDate(string $posted_date = null, bool $compare_time = true, ClockInterface $clock = null): string
if (!$compare_time) {
$now = mktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$abs = mktime(0, 0, 0, date('m', $abs), date('d', $abs), date('Y', $abs));
if (!$compare_time) {
$now = mktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$abs = mktime(0, 0, 0, date('m', $abs), date('d', $abs), date('Y', $abs));