From 6434ce96c946c7fa3d70f8109d88c1181c64ff81 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Mon, 6 Nov 2023 12:09:01 +0100 Subject: Add timezone getter to ITimeFactory Signed-off-by: Anna Larch --- lib/public/AppFramework/Utility/ITimeFactory.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/public/AppFramework') diff --git a/lib/public/AppFramework/Utility/ITimeFactory.php b/lib/public/AppFramework/Utility/ITimeFactory.php index 23f67d3dc38..be1b80ff617 100644 --- a/lib/public/AppFramework/Utility/ITimeFactory.php +++ b/lib/public/AppFramework/Utility/ITimeFactory.php @@ -58,4 +58,12 @@ interface ITimeFactory extends ClockInterface { * @since 26.0.0 */ public function withTimeZone(\DateTimeZone $timezone): static; + + /** + * @param string|null $timezone + * @return \DateTimeZone Requested timezone if provided, UTC otherwise + * @throws \Exception + * @since 29.0.0 + */ + public function getTimeZone(?string $timezone = null): \DateTimeZone; } -- cgit v1.2.3