Where do you get the Olson timezone database files

2019-03-30 05:28发布

According to the readme for timezone-js:

http://github.com/mde/timezone-js

you need to download the Olson timezone database and store the files in a directory on your web server so that timezone-js can work with them.

Where do you get the Olson database files that this project is referring to?

3条回答
小情绪 Triste *
2楼-- · 2019-03-30 06:01

Due to a lawsuit alleging copyright infringement in the Time Zone Database, the old sources are not available any more. On October 14, 2011, the Internet Assigned Numbers Authority (IANA), an ICANN department, took over responsibility for the maintenance of the Time Zone Database.

http://www.iana.org/time-zones

查看更多
太酷不给撩
3楼-- · 2019-03-30 06:01

The Internet Assigned Numbers Authority (IANA) now maintains the database. Here is a quick bash script to download and expand the files from the olson timezone ftp site

#!/bin/bash

# Load the files from the iana.org site.
wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz'

# Unzip them
gzip -dc tzcode*.tar.gz | tar -xf -
gzip -dc tzdata*.tar.gz | tar -xf -

# Optionally, remove the downloaded files
rm tz*-latest.tar.gz
查看更多
贼婆χ
4楼-- · 2019-03-30 06:24

Maybe not a precise answer to that specific question but I believe it is worth taking note of: http://momentjs.com/timezone/data/

Timezone data builder is really straightforward in use:

enter image description here

查看更多
登录 后发表回答