. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Statistics\Repository; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Registry; use Fisharebest\Webtrees\Site; use Fisharebest\Webtrees\SiteUser; use Fisharebest\Webtrees\Statistics\Repository\Interfaces\ServerRepositoryInterface; /** * A repository providing methods for server related statistics. */ class ServerRepository implements ServerRepositoryInterface { /** * @return string */ public function serverDate(): string { $format = strtr(I18N::dateFormat(), ['%' => '']); return Registry::timestampFactory()->now(new SiteUser())->format($format); } /** * @return string */ public function serverTime(): string { $format = strtr(I18N::timeFormat(), ['%' => '']); return Registry::timestampFactory()->now(new SiteUser())->format($format); } /** * @return string */ public function serverTime24(): string { return Registry::timestampFactory()->now(new SiteUser())->format('G:i'); } /** * @return string */ public function serverTimezone(): string { return Registry::timestampFactory()->now(new SiteUser())->format('T'); } }