diff --git a/addtocalendar.info.yml b/addtocalendar.info.yml
index a036586..606818b 100644
--- a/addtocalendar.info.yml
+++ b/addtocalendar.info.yml
@@ -3,5 +3,6 @@ type: module
 description: 'Add to calendar button to be used for event page.'
 # version: VERSION
 core: 8.x
+core_version_requirement: ^8 || ^9
 dependencies:
   - datetime
diff --git a/src/AddToCalendarApiWidget.php b/src/AddToCalendarApiWidget.php
index 43f4c42..b03548d 100644
--- a/src/AddToCalendarApiWidget.php
+++ b/src/AddToCalendarApiWidget.php
@@ -50,7 +50,7 @@ class AddToCalendarApiWidget {
     $this->atcOrganizerEmail = $site_mail;
     $this->atcDateStart = 'now';
     $this->atcDateEnd = 'now';
-    $this->timeZone = drupal_get_user_timezone();
+    $this->timeZone = date_default_timezone_get();
 
   }
 
