p3k/timezone
最新稳定版本:0.1.0
Composer 安装命令:
composer require p3k/timezone
包简介
Find the timezone of a given location
关键字:
README 文档
README
This library provides a function for retrieving the timezone for a given location.
It is implemented as a single file with no external dependencies. To do this, a horrible cheat is used. The timezone for a location is found by looking up the timezone of the nearest city. This means it's possible that the wrong timezone will be returned for locations near the borders between timezones, so you should only use this library if that is an acceptable compromise. The tradeoff is no fancy geometry or databases are required so this is comparatively fast.
API
$timezone = p3k\Timezone::timezone_for_location($latitude, $longitude);
Returns a string with the timezone name such as "Europe/Berlin", which can be used to create a new DateTimeZone object.
统计信息
- 总下载量: 23.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-01-12