diff options
author | Minteck <contact@minteck.org> | 2022-08-31 22:03:07 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-08-31 22:03:07 +0200 |
commit | b5f589c323f415bb42ea7069cb4d1a8a2233dd69 (patch) | |
tree | c3b80234ab7f463a2e7b8b672ceff57422b3496b /includes/ical/bin | |
parent | 09bd0164ebc020a54b944b7326dcba496fb5d82c (diff) | |
download | pluralconnect-b5f589c323f415bb42ea7069cb4d1a8a2233dd69.tar.gz pluralconnect-b5f589c323f415bb42ea7069cb4d1a8a2233dd69.tar.bz2 pluralconnect-b5f589c323f415bb42ea7069cb4d1a8a2233dd69.zip |
Update I guess - Stuffie
Diffstat (limited to 'includes/ical/bin')
-rw-r--r-- | includes/ical/bin/timezones.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/includes/ical/bin/timezones.php b/includes/ical/bin/timezones.php new file mode 100644 index 0000000..3bf3708 --- /dev/null +++ b/includes/ical/bin/timezones.php @@ -0,0 +1,20 @@ +<?php + +/** + * This file generates a map from windows timezones to tz database timezones + * + * @author Clement Wong <cw@clement.hk> + * @license http://www.opensource.org/licenses/mit-license.php MIT License + */ +$windows_timezones = []; +$windowstimezonexml = new DOMDocument(); +$windowstimezonexml->load('https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml'); +$zones = $windowstimezonexml->getElementsByTagName('mapZone'); +foreach ($zones as $zone) { + if ($zone->getAttribute('territory') === '001') { + $windows_timezones[$zone->getAttribute('other')] = $zone->getAttribute('type'); + } +} + +file_put_contents(__DIR__ . '/../src/WindowsTimezones.php', "<?php\n\$windows_timezones = " . var_export($windows_timezones, true) . ';'); + |