diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-03-03 13:49:41 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-03-03 17:32:17 +0000 |
| commit | 4459dc9a6d0c27769f8135175f3569e4fa287451 (patch) | |
| tree | ef59036e32fa9d84f9d4f4099a8a961f9f7c886d /app/I18N.php | |
| parent | bd1e4e13bc7083d954025fb0e640450409c7175b (diff) | |
| download | webtrees-4459dc9a6d0c27769f8135175f3569e4fa287451.tar.gz webtrees-4459dc9a6d0c27769f8135175f3569e4fa287451.tar.bz2 webtrees-4459dc9a6d0c27769f8135175f3569e4fa287451.zip | |
Convert from Carbon (v1) to CarbonImmutable (v2)
Diffstat (limited to 'app/I18N.php')
| -rw-r--r-- | app/I18N.php | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/app/I18N.php b/app/I18N.php index c4bf8642f7..0e0eeecb51 100644 --- a/app/I18N.php +++ b/app/I18N.php @@ -17,7 +17,6 @@ declare(strict_types=1); namespace Fisharebest\Webtrees; -use Carbon\Carbon; use Collator; use Exception; use Fisharebest\Localization\Locale; @@ -832,26 +831,4 @@ class I18N return sprintf($message, ...$args); } - - /** - * Display a timestamp in the user's local timezone. - * - * @param Carbon $timestamp - * @param string $format - * @param string $timezone - * - * @return string - */ - public static function localTime(Carbon $timestamp, string $format = '', string $timezone = ''): string - { - $format = $format ?: strtr(self::dateFormat() . ' ' . self::timeFormat(), ['%' => '']); - - $timezone = $timezone ?: Auth::user()->getPreference('TIMEZONE', Site::getPreference('TIMEZONE', 'UTC')); - - $local_timestamp = $timestamp->copy(); - - $local_timestamp->tz = $timezone; - - return $local_timestamp->format($format); - } } |
