summaryrefslogtreecommitdiff
path: root/sql/gen_win_tzname_data.ps1
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-04-29 22:57:21 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-04-30 09:16:39 +0200
commita8793a2c02f805a4a1c4dbd1416b594169b77541 (patch)
tree066ee000d13ed8ee30c5372d75698dc005309425 /sql/gen_win_tzname_data.ps1
parentba9f8776c2803ac6273499e5a0e069998a23c88b (diff)
downloadmariadb-git-a8793a2c02f805a4a1c4dbd1416b594169b77541.tar.gz
MDEV-19243 Fix timezone handling on Windows to report standard timezone names
Diffstat (limited to 'sql/gen_win_tzname_data.ps1')
-rw-r--r--sql/gen_win_tzname_data.ps111
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/gen_win_tzname_data.ps1 b/sql/gen_win_tzname_data.ps1
new file mode 100644
index 00000000000..13b6ce6ffd0
--- /dev/null
+++ b/sql/gen_win_tzname_data.ps1
@@ -0,0 +1,11 @@
+# Generates a header file for converting between Windows timezone names to tzdb names
+# using CLDR data.
+# Usage: powershell -File gen_win_tzname_data.ps1 > win_tzname_data.h
+
+write-output "/* This file was generated using gen_win_tzname_data.ps1 */"
+$xdoc = new-object System.Xml.XmlDocument
+$xdoc.load("https://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml")
+$nodes = $xdoc.SelectNodes("//mapZone[@territory='001']") # use default territory (001)
+foreach ($node in $nodes) {
+ write-output ('{L"'+ $node.other + '","'+ $node.type+'"},')
+}