diff --git a/src/AppHelper.php b/src/AppHelper.php new file mode 100644 index 0000000000..e89f94f2e7 --- /dev/null +++ b/src/AppHelper.php @@ -0,0 +1,49 @@ +timezone = (new DateTimeZone($timezone))->getName(); + + DateTimeFormat::setLocalTimeZone($this->timezone); + } + + /** + * Get the timezone + * + * @return int + */ + public function getTimeZone(): string + { + return $this->timezone; + } +} diff --git a/src/DI.php b/src/DI.php index 46010ce62b..2c36c9c190 100644 --- a/src/DI.php +++ b/src/DI.php @@ -78,6 +78,11 @@ abstract class DI return self::$dice->create(App::class); } + public static function apphelper(): AppHelper + { + return self::$dice->create(AppHelper::class); + } + /** * @return Database\Database */