2017 © Pedro Peláez
 

library timezone

Find the timezone of a given location

image

p3k/timezone

Find the timezone of a given location

  • Thursday, January 12, 2017
  • by aaronpk
  • Repository
  • 3 Watchers
  • 2 Stars
  • 439 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 53 % Grown

The README.md

Timezone

This library provides a function for retrieving the timezone for a given location., (*1)

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., (*2)

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., (*3)

The Versions

12/01 2017

dev-master

9999999-dev https://github.com/aaronpk/p3k-timezone

Find the timezone of a given location

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

date timezone p3k

12/01 2017

0.1.0

0.1.0.0 https://github.com/aaronpk/p3k-timezone

Find the timezone of a given location

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

date timezone p3k