替代方案
请注意,不同项目可能有不同的设计目标(速度、准确性、数据来源等)。请自行研究哪个最适合你的使用场景。
本页面并非所有替代方案的完整列表。
建议先查看 evansiroky/timezone-boundary-builder 的 Lookup Libraries 部分。
Stack Overflow 上还有一个相关问题:How to get a time zone from a location using latitude and longitude coordinates?。
速度、内存与准确率对比
下面的雷达图基于 tz-benchmark 的持续基准测试结果, 从查询速度、峰值内存和准确率(错误率)三个维度对比 Go、Python、Rust 生态中的主要时区查询库。三个维度均使用统一的对数刻度,数值越靠外表现越好;点击图下方的包名可查看具体数据。
Go
- https://github.com/ringsaturn/tzf
- https://github.com/bradfitz/latlong
- https://github.com/evanoberholster/timezoneLookup
- https://github.com/albertyw/localtimezone/
- https://github.com/ugjka/go-tz
- https://github.com/zsefvlol/timezonemapper
Rust
- https://github.com/ringsaturn/tzf-rs
- https://github.com/twitchax/rtz
- https://github.com/huonw/tz-search
- https://github.com/nicholasbishop/zone-detect-rs
- https://github.com/moranbw/spatialtime
Python
- https://github.com/ringsaturn/tzfpy
- https://github.com/jannikmi/timezonefinder
- 参见其与 tzfpy 的对比:Comparison to tzfpy 以及 tzfpy 相关讨论:
ringsaturn/tzfpy#94
- 参见其与 tzfpy 的对比:Comparison to tzfpy 以及 tzfpy 相关讨论:
- https://github.com/pegler/pytzwhere
Ruby
Swift
数据库
最后更新于