. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Statistics\Repository; use Fisharebest\Webtrees\Carbon; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Statistics\Repository\Interfaces\BrowserRepositoryInterface; /** * A repository providing methods for browser related statistics. */ class BrowserRepository implements BrowserRepositoryInterface { /** * @return string */ public function browserDate(): string { $format = strtr(I18N::dateFormat(), ['%' => '']); return Carbon::now()->local()->format($format); } /** * @return string */ public function browserTime(): string { $format = strtr(I18N::timeFormat(), ['%' => '']); return Carbon::now()->local()->format($format); } /** * @return string */ public function browserTimezone(): string { return Carbon::now()->local()->format('T'); } }