Merge pull request #22631 from braders/calculateBaseScheduleDate-docblock
[civicrm-core.git] / CRM / Core / SelectValues.php
index 5323ace062710db082331336c07c427cdad0cc3d..c15c14f66283e3bbb3046c7f74efe8c246eab26b 100644 (file)
@@ -1111,4 +1111,22 @@ class CRM_Core_SelectValues {
     ];
   }
 
+  public static function timezone() {
+    $tzlist = &Civi::$statics[__CLASS__]['tzlist'];
+
+    if (is_null($tzlist)) {
+      $tzlist = [];
+      foreach (timezone_identifiers_list() as $tz) {
+        // Actual timezone keys for PHP are mapped to human parts.
+        $tzlist[$tz] = str_replace('_', ' ', $tz);
+      }
+
+      // Add 'Etc/UTC' specially, as timezone_identifiers_list() does
+      // not include it, but it is the IANA long name for 'UTC'
+      $tzlist['Etc/UTC'] = ts('Etc/UTC');
+    }
+
+    return $tzlist;
+  }
+
 }